Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added Agoo to the TFB #59

Closed
GertThiel opened this issue May 3, 2019 · 11 comments
Closed

I added Agoo to the TFB #59

GertThiel opened this issue May 3, 2019 · 11 comments

Comments

@GertThiel
Copy link

https://github.com/GertThiel/FrameworkBenchmarks/tree/master/frameworks/Ruby/agoo

Maybe you want to have a look, maybe want to optimize?

@ohler55
Copy link
Owner

ohler55 commented May 3, 2019

The code looks pretty reasonable. The only thing I would change might be the number of workers. That is something you would have to experiment with though. I suspect the database will be the most significant bottleneck since it looked like the queries are synchronous. Spreading them out over as many separate real threads will probably give the best performance. I wonder if the connection pool make a significant difference or if more workers would give better results.

Nice charts by the way.

@GertThiel
Copy link
Author

The charts aren't mine. I only added Agoo to the TechEmpower Framework Benchmark (TFB): TechEmpower/FrameworkBenchmarks#4709

I suspect the database will be the most significant bottleneck since it looked like the queries are synchronous. Spreading them out over as many separate real threads will probably give the best performance.

Do you have sample code how to accomplish that?

@ohler55
Copy link
Owner

ohler55 commented May 3, 2019

Just change the worker_count in app.rb and maybe the size of the connection pool. If it is easy for you to run the test try multiplying the worker_count by some scaling factor and see what yields the best results. Using a machine close to the one they do the benchmark runs on would be best of course.

@GertThiel
Copy link
Author

The TFB runs the actual benchmark in Docker containers. worker_count is derived from nproc (see here). The pool is set as big as set by the competing frameworks( everyone uses about 250).

The machines which will run the benchmarks is considerably different from mine. So nproc seems to be a good strategy to configure worker_count except you think a multiplicator would be better (Two workers per processor core?).

@ohler55
Copy link
Owner

ohler55 commented May 3, 2019

It might be better to have a multiplier on worker_count since most of the time will be spent waiting for the database.

I'm not sure how the connection pool works but if it establishes 250 connections right away that could be a problem if mongo is not configured for for a large number of connections. Let me explain a little.

The worker_count is used to create that number of separate Ruby processes. They show up as separate entries when running top. Each one is running app.rb so with the pool at 250 connections and lets say 12 CPUs thats a lot of connections. Looking at it still further we know that Ruby uses a global lock for each app so the app is locked until the database returns. Depending on the database driver it may allow other Ruby threads to run in which case increasing the Agoo thread_count could help. Having connections in the pool that are not used will only slow down the server as those connections still need to be checked and in MongoDB's case there is a new thread created for each connection. So I would suggest the pool size should be the same as the thread_count.

So I threw in another variable, didn't I. Not knowing how the drivers are implemented makes it tough to give specific values for the worker_count and thread_count but they are configurable so some trial runs with different values should allow the best values to be determined.

@ohler55
Copy link
Owner

ohler55 commented Jun 21, 2019

What ever happened with this? I did not see Agoo on the results page.

@ohler55
Copy link
Owner

ohler55 commented Jul 13, 2019

No response. Closing.

@ohler55 ohler55 closed this as completed Jul 13, 2019
@ElMassimo
Copy link

What ever happened with this? I did not see Agoo on the results page.

@ohler55 In case you never found it, it was added in TechEmpower/FrameworkBenchmarks#4709.

Have in mind the implementation is flagged as Stripped, which means it's not shown by default, and needs to be manually enabled in the filters:

Screen Shot 2020-06-02 at 1 37 04 PM

@ohler55
Copy link
Owner

ohler55 commented Jun 2, 2020

I failed to find the implementation approach option for Stripped in the filters. All that appears is Realistic. I would love to see the results and would be glad to check the configuration to see if it is optimum. I would also like to get Agoo so it shows up with Realistic if you can point me at what to takes to earn that label.

@ElMassimo
Copy link

ElMassimo commented Jun 2, 2020

From the general requirements in the project:

This project intends to measure performance of production-grade deployments of real-world web application frameworks and platforms. All implementations are expected (but not required) to be based on robust implementations of the HTTP protocol. Implementations that are not based on a realistic HTTP implementation will be marked as Stripped. Rather than stipulate a rigid specification of HTTP requirements, we defer to common sense: the implementation should provide a viable subset of HTTP to reasonably unbiased outsiders familiar with HTTP.

Not familiar with how the decision is made, in this case it seems it was added as Stripped by @GertThiel.

Perhaps you can make a pull request with changes to the sample app to flag it as Realistic instead.

@ohler55
Copy link
Owner

ohler55 commented Jun 2, 2020

Thanks. I'll do that and see what the response is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants