Can anyone comment on the improvement per process of moving to Sinatra?
I find that my web API uses around 100MB per Passenger Rails 3 process. I'm wondering what the improvement would be if I switched to Sinatra.
Here's a random not-real-world benchmark to give you just a little idea:
| Real | Private | Vir. Priv. |
---------------+---------+---------+------------|
[1] Rails | 38.6MB | 35.9MB | 76.3MB |
---------------+---------+---------+------------|
[2] Sinatra | 18.7MB | 16.2MB | 51.7MB |
---------------+---------+---------+------------|
[3] + Haml | 19.6MB | 17.0MB | 53.7MB |
---------------+---------+---------+------------|
[4] + Sequel | 24.4MB | 21.7MB | 54.8MB |
---------------+---------+---------+------------|
require 'sinatra'; get('/'){ "Hello" }
, make 1 request.get ('/'){ haml "%p Hello" }
, make 1 request.DB = Sequel.sqlite
, make 1 request.All tested on OS X. This test shows that a) Sinatra is far more bare-bones than Rails, and b) you will need to compare apples to apples (on the OS of your choice ;) if you want any meaningful numbers. The same application with the same functionality.
My real-world apps running on Windows using Thin+Sequel+Haml+pg tend to run around 50-90MB per instance (depending on the app I run 2-4 instances behind a reverse proxy). YMMV.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With