-
Notifications
You must be signed in to change notification settings - Fork 11
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
Cannot run agoo benchmark #12
Comments
Maybe it's related to ohler55/agoo#20 |
Agoo changes as of version 2.0.0 so that the server is the Agoo::Server module. I have some examples on how to start I with and without #config.ru
class FlyHandler
def call(req)
[ 200, { }, [ "flying fish" ] ]
end
end
Rack::Handler::Agoo.run(FlyHandler.new) Start with
Of course there are additional options to run but that is the basic. |
|
Oh, I guess I can use |
yes, you can. I'll post a revised benchmark file here in a moment. |
I thought I'd give you some additional feedback. Running the benchmark middleware (
|
I'd suggest that we try to test all servers on a level playing field, using |
Agoo does not yet have clustering. That is in the works but not there yet. I know that is needed to scale the Ruby calls. Agoo has raw speed a single core down fairly well but it lacks the clustering option of Falcon. You must have a nice machine to have 8 cores 😄 I am fine using rackup but I'd also like to test the static file options for those servers that support it. Agoo now has an option to specify assets directories so even with rack it can serve static assets. For benchmarking it would be nice to show.
I think arguments could be made for each of those modes. What do you think? |
Only you can make a decision what works best in terms of options. The defacto standard for static assets is to use There is very little reason to change it IMHO, but having it as an option wouldn't hurt.
It works, and you should support it, but I don't know if you can expect great performance from it.
I don't think it's stupid that |
I'm a bit surprised you are only getting 9K req/sec though. Are you ubuntu or OS X? OS X is pretty poor for IO. I'll have to check and see what is going on. I was getting 100K with Ubuntu earlier. |
I agree that macOS has a shitty IO layer. I was running on the same linux box with (4 core / 8 hyper threads). The upper limit with a simple TCP epoll server is around 400,000 connections per second. |
I made a |
Is the default Maybe it is |
Maybe some explanation or comparison between |
The default is I'm pretty sure that is also the default for rails - if you make your own rails website it will make a |
Are you using I believe Rails serves assets from the directories listed in |
Rails by default serves public assets from |
Wow, your are so right about the |
Benchmarks show the performance of the slowest link in the chain. Using |
There are some frustrating road blocks in your path w.r.t. real world performance and Real Ruby applications don't scale up that well. The main issue for the server implementation is the GVL, but another part of that problem is blocking IO and the typical thread-per-request model. I've started trying to address some of these issues here:
These changes indirectly benefit you because then you can use your reactor/selector design with existing Ruby code with no changes required to that code. I'd appreciate if you can comment on the 2nd issue above, mention how |
I'll have to check |
Don't try benchmarking a real rails application then - you are going to find out some painful limits w.r.t. the slowest link in the chain :p |
I did do some benchmarks with Rails. Agoo was faster serving generated content than the default but only by 50% or so. It was 2000 times faster serving static assets though. Oh, second point. That would be the config.ru file. Yeah, it should work with just |
I'd be surprised by this result, if you only use one CPU core. The majority of the time should be in Rails code, not I think you'd find that any web server that can run multiple processes, with decent single-core performance would be better than a single core solution. |
Agoo does use multiple threads but only with the GVL any more than one Ruby eval thread doesn't help that much. There is that option in Agoo but Agoo does not yet fork to run multiple separate Ruby interpreters. I assume thats what you are referring to when you say core, right. I missed that when you first mentioned cores. I was thinking CPU cores, not Ruby cores. |
Sorry if my terminology was confusing. I guess by n-cores I mean n processes which can run in parallel. You obviously need n CPU cores in order for this to occur. You can still run 16 processes on 8 cores, but you'll end up with pre-emptive multi-tasking. For Ruby, running n-cores is preferable to n-threads because Ruby threads are concurrently scheduled when running Ruby code which makes them bad w.r.t. physical CPU utilisation. |
That has been my experience with Ruby threads as well. The only downside to multiple cores is the app has to be stateless but I suppose Rails and Rack users have accepted that by now and rely on a database for all state. |
The text was updated successfully, but these errors were encountered: