First, how do you measure memory usage?
It is assumed that you are using passive memory statistics for a more accurate understanding of memory usage (as opposed to the top, etc.).
All in all, it's really hard to say without doing some tests yourself - memory usage can vary greatly depending on what your application actually does, and Sinatra does not necessarily mean less memory.
For example, if you use ActiveRecord, models are cached by the framework in production to reduce load times. This will happen regardless of the application structure you use.
There may be some things you can do to customize the Rails stack.
Experimenting with Ruby Versions. REE may take advantage of some memory benefits when used with a passenger. Ruby 1.9.2 has many performance improvements.
See the memory options for passengers:
- passenger_spawn_method
- passenger_max_pool_size
Another thing you can do is remove the unused parts of the Rails stack itself (using various Rails Rack options ).
source share