Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much memory should a Ruby on Rails application consume?

My Ruby on Rails application is consuming around 129 MB of memory.. is this normal?

I have around 3,000 unique visitors a day, i have no complex queries...

My users table has about 18k rows.

like image 226
Will Avatar asked Jun 04 '10 05:06

Will


1 Answers

129MB doesn't seem too excessive to me, what I find more important is does that number grow over time?

if it does the problem is probably how much of your dataset you are loading into memory on a request

check out: http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-its-bloat/

in breif: Instantiating too many active record objects is a place where rails app's memory footprint really grows.

If in a request, you were to iterate over all 18k users for some reason, and worse, iterate over all of their posts (or whatever associations you have), you'd be instantiating a ton of objects, which (should) get cleared after the request, but ruby doesn't give the memory back to the system after it has been alocated.

like image 98
Dennis Collective Avatar answered Nov 19 '22 01:11

Dennis Collective