Live data from Hacker News

500 requests/s with Ruby on Rails 4 on a 5$ / month server

blog.wiemann.name

11–16 of 16 posts

Re: 500 requests/s with Ruby on Rails 4 on a 5$ / month server

#11
Cool write up - I never heard about Puma server. I should check it.

BTW, similar result like this can be also achieved with any RoR and jruby 1.7 (for me jruby 1.7 uses much less mem then 1.6). Threads in jruby are quite cheap. And as always database is the bottleneck but jruby is cool because you can embed BerkeleyDB in it (so open temp Berkely DB and cache things like crazy).

Re: 500 requests/s with Ruby on Rails 4 on a 5$ / month server

#13
post #5

Earlier quoted context omitted.

Indeed Complete requests: 40 Failed requests: 13 is far from good

And 28 were non 2xx, which is also a failure. Probably db issues since there is no way SQLite can handle 20 concurrent connections.

I corrected the blog post with a correct sample size. Thanks for the feedback!

Re: 500 requests/s with Ruby on Rails 4 on a 5$ / month server

#14
What is the best way to establish optimal pool size? The article seems to gloss over this and instead mentions 'you need to set pool: 25', but I doubt this is a one size fits all solution.

Anyone have any experience profiling these sorts of things that can share some info?

Re: 500 requests/s with Ruby on Rails 4 on a 5$ / month server

#15

Earlier quoted context omitted.

And 28 were non 2xx, which is also a failure. Probably db issues since there is no way SQLite can handle 20 concurrent connections.

I corrected the blog post with a correct sample size. Thanks for the feedback!

You're missing the ab output now which also hurts the quality of the analysis.

Re: 500 requests/s with Ruby on Rails 4 on a 5$ / month server

#16
post #14

What is the best way to establish optimal pool size? The article seems to gloss over this and instead mentions 'you need to set pool: 25', but I doubt this is a one size fits all solution. Anyone have any experience profiling these sorts of things that can share some info?

You probably want to find out max_connections for your server.

Then figure out how many other connections you'll need outside your server (rails console, cron jobs, commandline) subtract that and you have your number.

I like to have about 10 spare connections.

Running

select name, setting from pg_settings where name = 'max_connections';

in postgres. I see I have 100 max connections.

So that minus 10 gives me a pool size of 90.

Post reply on HN