Preface: Please don’t start a discussion on premature optimization, or anything related. I’m just trying to understand what kind of performance I can get from a single server with rails.
I have been benchmarking ruby on rails 3 and it seems the highest rate of requests per second I can get is around 100 requests per second.
I used phusion passenger with nginx, and Ruby 1.8.7.
This is on a ec2 m1.large instance:
7.5 GB memory
4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each)
850 GB instance storage
64-bit platform
I/O Performance: High
API name: m1.large
The page was a very simple action that wrote a single row into mysql.
user = User.new
user.name = "test"
user.save
I am assuming no caching (memcache, etc), I just want to get a feel for the raw numbers.
I used apache bench on the same ec2 instance, and I used varying levels of # of requests (from 1000 to 10000 and varying numbers of concurrent requests 1/5/10/25/50/100).
The EC2
m1.largeinstance is really not that fast, so these numbers aren’t surprising. If you want performance, you can either spring for a larger instance, as there are now some with 80 ECUs, or try a different provider.I’ve found that Linode generally offers higher performance for the same price, but is not as flexible and doesn’t scale to very large numbers of servers as well. It’s a much better fit if you’re in the “under 20 servers” phase of rolling out.
Also don’t think that MySQL is a no-cost operation.