When upgrading from Ruby 1.8.6 to Ruby Enterprise 1.8.7 p334, the memory size almost doubled. This happened on each of the five updated Fedora 8 servers. We are running Rails 1.2.6 with Passenger 3.0.4.
Munin gets the memory size for each process by summing the vsz and rsz columns from $ ps axo pid,comm,pmem,vsz,rsz . (The size of virtual memory and the size of resident memory increase the same amount)
I understand that these columns usually overestimate the amount of memory actually used by processes, but if it was used to measure 1.8.6 and then 1.8.7 REE, they should be equally bloated and therefore still comparable.
In addition, the fixed memory for the machine (as indicated in / proc / memstat) now regularly overrides what is new. The amount of committed memory has increased significantly, and it seems that we are now in the swap area.
We have not set up garbage collection yet, but I do not see how this will affect the total amount of memory.
I have included the GC.copy_on_write_friendly variable as recommended by the Phusion FAQ.
What is the explanation for this 100 percent increase in memory usage and how can I fix it? Any ideas on how to fix or even better control / debug are appreciated.
Thanks.
--- UPDATE
To test the performance, I reduced the number of running instances (PassengerMaxPoolSize) from 12 to 10 on a single server. On the other hand, I increased PassengerPoolIdleTime to 15 minutes. I have a third one that is used as a control.
I am considering hosting a version other than enterprise 1.8.7p334 to determine if it is 1.8.7 or Enterprise Edition.
Anyone have any experience with this?
Considering the individual Rails processes, they are about 120 MB per process at 1.8.6 and 175 MB / process in REE 1.8.7, as indicated in the passenger statistics.
--- UPDATE 2
I put MRI 1.8.7 on the server for comparison with REE 1.8.7. The results were worse, including a higher resident memory number size and passive memory statistics. Of course, the exchange began.
This makes me think that 1.8.7 just has a larger footprint than 1.8.6.
--- UPDATE 3
I put MRI 1.8.7 on the server, it was much worse than MRI 1.8.6 in terms of memory usage, so I immediately returned to MRI 1.86.
I ran the average size of the Rails process, as indicated in the passive memory statistics. REE 1.8.7 processes were 73 MB larger, which seems pretty big.
This means that I need to have significantly fewer processes running in the same amount of memory.
See how they work with fewer processes. I am also starting to configure GC.
--- UPDATE 4
Ruby 1.8.7 does not seem to support Rails 1.2.6. The first officially supported version 1.8.7 is Rails 2.1. We will find out after the update if this is the root of the problem.