# Mongrel CPU Usage

**URL:** <https://www.ruby-forum.com/t/mongrel-cpu-usage/102678>\
**Category:** Deployment\
**Created:** [February 7, 2007, 5:15am UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678 "2007-02-07T05:15:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 7, 2007, 5:15am UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/1 "2007-02-07T05:15:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 7, 2007, 2:57pm UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/2 "2007-02-07T14:57:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 7, 2007, 3:07pm UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/3 "2007-02-07T15:07:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 7, 2007, 4:35pm UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/4 "2007-02-07T16:35:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 7, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/5 "2007-02-07T17:33:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 12:46am UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/6 "2007-02-10T00:46:05Z")

</div>

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 🙂 ?

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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [July 3, 2007, 8:58am UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/7 "2007-07-03T08:58:17Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [February 10, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/mongrel-cpu-usage/102678/8 "2007-02-10T14:17:12Z")

</div>

hey there

On Feb 8, 3:32 am, “Vegan Buddy” [removed\_email\_address@domain.invalid](mailto: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
