Rails process takes huge memory

111 views
Skip to first unread message

James

unread,
Jan 26, 2012, 9:22:17 AM1/26/12
to Phusion Passenger Discussions
Hi

Our application uses RoR with phusion passenger. Some of the rails
process takes memory more than 1 GB and some upto 80 MB. What could be
the possibility for this difference.

16490 606.4 MB 460.0 MB Rails: /app
17408 1265.8 MB 1116.2 MB Rails: /app
17419 935.2 MB 784.3 MB Rails: /app
17431 606.4 MB 452.1 MB Rails: /app
17461 605.4 MB 460.9 MB Rails: /app
17479 1262.2 MB 789.3 MB Rails: /app
18613 234.0 MB 90.5 MB Rails: /app
18616 235.0 MB 91.9 MB Rails: /app
18619 604.5 MB 459.6 MB Rails: /app
18622 607.0 MB 454.5 MB Rails: /app
18625 1263.2 MB 786.1 MB Rails: /app
18628 603.5 MB 449.8 MB Rails: /app
18631 235.0 MB 91.9 MB Rails: /app
19024 234.0 MB 74.8 MB Rails: /app
19027 234.0 MB 81.1 MB Rails: /app
19030 603.8 MB 459.6 MB Rails: /app
19033 234.0 MB 85.7 MB Rails: /app
19036 234.0 MB 82.5 MB Rails: /app
### Processes: 28
### Total private dirty RSS: 15169.52 MB

The concurrent users reaches more than 4000

Adam R. B. Jack

unread,
Feb 5, 2012, 6:37:02 PM2/5/12
to phusion-...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.


--
Find your nature: http://wildobs.com






sgoel

unread,
Feb 10, 2012, 5:05:24 PM2/10/12
to Phusion Passenger Discussions
How did you get so many rails processes? Can you please share your
Apache and passenger configurations? I am trying to get more than 6
concurrent request. Even after changing "PassengerMaxPoolSize" to 10,
it doesn't go beyond 6. The 7th request wait till one of request from
6 is completed.
> > For more options, visit this group athttp://groups.google.com/group/phusion-passenger?hl=en.

Adam R. B. Jack

unread,
Feb 10, 2012, 5:08:57 PM2/10/12
to phusion-...@googlegroups.com
For me, I set "PassengerMinInstances".

BTW: Don't copy the rest of what I am configuring, I'm fighting some bugly leaks.

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.9
PassengerRuby /home/ec2-user/scripts/ruby_wrapper.sh
#PassengerRuby /usr/bin/ruby
PassengerMaxPoolSize 12
PassengerMinInstances 10
RackEnv production
RailsEnv production
PassengerPoolIdleTime 600
PassengerMaxRequests 2000


[ec2-user@domU-12-31-39-06-40-15 ~]$ pstat
*** Cleaning stale folder /tmp/passenger.1.0.1068
----------- General information -----------
max      = 12
count    = 10
active   = 0
inactive = 10
Waiting on global queue: 0

----------- Application groups -----------
/wildobs/app:
  App root: /wildobs/app
  * PID: 19471   Sessions: 0    Processed: 1381    Uptime: 13h 5m 26s
  * PID: 19453   Sessions: 0    Processed: 470     Uptime: 13h 6m 38s
  * PID: 19457   Sessions: 0    Processed: 399     Uptime: 13h 5m 30s
  * PID: 19473   Sessions: 0    Processed: 783     Uptime: 13h 5m 26s
  * PID: 19459   Sessions: 0    Processed: 1       Uptime: 13h 5m 29s
  * PID: 19469   Sessions: 0    Processed: 0       Uptime: 13h 5m 27s
  * PID: 19467   Sessions: 0    Processed: 0       Uptime: 13h 5m 27s
  * PID: 19465   Sessions: 0    Processed: 0       Uptime: 13h 5m 28s
  * PID: 19463   Sessions: 0    Processed: 0       Uptime: 13h 5m 29s
  * PID: 19461   Sessions: 0    Processed: 0       Uptime: 13h 5m 29s



For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.

Stewart Mckinney

unread,
Feb 10, 2012, 5:09:58 PM2/10/12
to phusion-...@googlegroups.com
What version of Ruby are you using?

sgoel

unread,
Feb 10, 2012, 5:18:21 PM2/10/12
to Phusion Passenger Discussions
My Env:
Apache2.2.21, passenger-3.0.2, ruby 1.8.7, Rails 2.3.5, OS: CentOS
release 5.5

Stewart Mckinney

unread,
Feb 10, 2012, 5:24:32 PM2/10/12
to phusion-...@googlegroups.com
Ah, sorry, that was directed at James. If he is using REE ( ruby enterprise edition ), that could explain the memory discrepancy. REE is "copy-on-write", which means subsequent copies of the same server will use less memory because they share memory until the values stored in memory are overwritten, at which point the value is "copied" for all servers that still use that value, more memory is allocated for the server that overwrote the value, and the new value finally stored.
Reply all
Reply to author
Forward
0 new messages