Mongrel CPU Usage


#1

Hi
Just wondering whats reasonable to expect in terms of mongrels CPU
usage. I’ve established an app with 1 mongrel instance on a debian
etch box. This process idles (yes idles) on 10% - 20% - this means say
I install 10 apps each with 2 mongrels, I’ve used twice my cpu
capacity without even accepting a hit!

is this reasonable/typical behvaviour from mongrel? What are the
minimum specs of a cpu people are typically using for mongrel?

heres my /proc/cpuinfo:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Athlon™
stepping : 0
cpu MHz : 1250.065
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
bogomips : 2506.90

Thanks for any hints
Glenn


#2

I have never seen this kind of behavior before. You sure they’re
idle?

Here’s what ‘top’ looks like on my non-idle site:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1115 deploy 16 0 50924 11m 1184 S 0.0 5.3 1:53.27
mongrel_rails
1119 deploy 16 0 61364 44m 1252 S 0.0 20.0 123:45.86
mongrel_rails

Note that the CPU column shows 0%. So I would say that what you’re
seeing is not standard.

-Ryan


#3

glenn wrote:

Hi
Just wondering whats reasonable to expect in terms of mongrels CPU
usage. I’ve established an app with 1 mongrel instance on a debian
etch box. This process idles (yes idles) on 10% - 20% - this means say
I install 10 apps each with 2 mongrels, I’ve used twice my cpu
capacity without even accepting a hit!

is this reasonable/typical behvaviour from mongrel? What are the
minimum specs of a cpu people are typically using for mongrel?

FWIW, I am currently running a Rails app with 3 mongrel instances on 2
Ubuntu Dapper boxes. When I am not getting any traffic the boxes show 0%
CPU utilization. Even under heavy loads it is unusual for me to see
more than 2-3% utilization. My boxes both have 2 dual core 3.8Ghz Zeons,
but I wouldn’t expect to see the kind of utilization you are seeing even
with slower processors.

Phil


#4

I’ve got 1 mongrel instance running in development mode on my win32
box. It is idling at 0% cpu, using 96 MB of ram.
The box has a 2 core cpu, 1 GB.


#5

If you’re checking it with ps u, keep in mind that the %cpu is the
average usage over the time of the process. So it will be high
initially (process startup is usually cpu intensive) and then slowly
decline and eventually level off.

If it is still 10-20% after a few minutes than there is definitely
something unusual. Do you see anything in the mognrel3000.log or the
development.log files?

I have similar (lesser) hardware (see below.)

Here’s my ps output, 3rd column is %cpu

shawn 2628 1.8 2.2 23772 21452 pts/3 S+ 10:16 0:04
/usr/bin/ruby /usr/bin/mongrel_rails start -p 3002
shawn 2686 13.3 2.3 24784 22464 pts/4 S 10:19 0:07
/usr/bin/ruby /usr/bin/mongrel_rails start -p 3009

A few minutes later:

shawn 2628 0.8 2.2 23772 21452 pts/3 S+ 10:16 0:04
/usr/bin/ruby /usr/bin/mongrel_rails start -p 3002
shawn 2686 2.3 2.3 24784 22464 pts/4 S 10:19 0:07
/usr/bin/ruby /usr/bin/mongrel_rails start -p 3009

/proc/cpuinfo
vendor_id : AuthenticAMD
cpu family : 6
model : 7
model name : AMD Duron™ Processor
stepping : 1
cpu MHz : 1283.896
cache size : 64 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 2562.45

Shawn


#6

hi all - thanks for your replies - sorry i havent been around to
respond to them - ok im feeling much better now, that I know that this
isnt normal - at least now I know that its me with the prob, not just
how mongrel is, or a limitation of my box - now I just have to work
out wtf is going on… open to any ideas :slight_smile: ?

ryandaigle:

I have never seen this kind of behavior before. You sure they’re
idle?

All i know is that there are no hits happening in this time, the
server might run for hours without even a hit against apahce, let
alone anything proxied back to mongrel and still it sits >10%. I guess
its clearly not ‘idle’ but its certainly not serving web pages.

will check mongrel logs as you suggest veganbuddy

thanks again for all replies


#7

i have a new install of mongrel on ubuntu edgy, front-end is apache
2.2.4. i see the same thing and this is the first time i’ve seen anyone
mention this. there are no hits on the server and mongrel runs at 10-13%
cpu usage, while ‘idle’.

nothing unusual in the logs. i ran -B for full debugging and looked at
the threads.log, files.log, objects.log, etc.

so glenn isn’t the only one…

glenn wrote:

hey there

On Feb 8, 3:32 am, “Vegan Buddy” removed_email_address@domain.invalid wrote:

If you’re checking it with ps u, keep in mind that the %cpu is the
average usage over the time of the process. So it will be high
initially (process startup is usually cpu intensive) and then slowly
decline and eventually level off.

If it is still 10-20% after a few minutes than there is definitely
something unusual. Do you see anything in the mognrel3000.log or the
development.log files?

i’ve checked the logs - nothing untoward in any logs. no activity for
days, been up for week now, and still sititng on 10%

thanks for the stats below though - al least i know what should be
happening
glenn


#8

hey there

On Feb 8, 3:32 am, “Vegan Buddy” removed_email_address@domain.invalid wrote:

If you’re checking it with ps u, keep in mind that the %cpu is the
average usage over the time of the process. So it will be high
initially (process startup is usually cpu intensive) and then slowly
decline and eventually level off.

If it is still 10-20% after a few minutes than there is definitely
something unusual. Do you see anything in the mognrel3000.log or the
development.log files?

i’ve checked the logs - nothing untoward in any logs. no activity for
days, been up for week now, and still sititng on 10%

thanks for the stats below though - al least i know what should be
happening
glenn