# Apache processes occassionaly hanging under mod rails

**URL:** <https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006>\
**Category:** Deployment\
**Created:** [August 5, 2008, 4:11am UTC](https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006 "2008-08-05T04:11:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [August 5, 2008, 4:11am UTC](https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006/1 "2008-08-05T04:11:54Z")

</div>

Every couple hours I always get a few apache processes that for some  
reason never quit properly. When I get enough of them my apache no  
longer responds to any web requests and I need to restart it. It looks  
something like this (notice the times for the first 3 apache processes):

www-data 19283 16243 0 18:24 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19426 16243 0 18:32 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19437 16243 0 20:31 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19460 16243 0 21:49 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19470 16243 0 21:52 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19483 16243 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19487 16243 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19489 16243 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19493 16243 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k  
start  
www-data 19501 16243 0 21:55 ? 00:00:00 /usr/sbin/apache2 -k  
start

I have killed all of them currently that haven’t been spawned in the  
past 15 minutes but I think they are stuck at sending response…last  
time i checked under [http://localhost/server-status](http://localhost/server-status)

the only message in my apache error logs are occasionaly:

[Mon Aug 04 21:25:13 2008] [info] server seems busy, (you may need to  
increase StartServers, or Min/MaxSpareServers), spawning 8 children,  
there are 4 idle, and 21 total children  
[Mon Aug 04 22:05:28 2008] [info] server seems busy, (you may need to  
increase StartServers, or Min/MaxSpareServers), spawning 8 children,  
there are 3 idle, and 19 total children

which I have just upped my server settings (i dont think the stalled  
processes are related to those error message though):

Timeout 120  
MaxKeepAliveRequests 200  
KeepAliveTimeout 3

 StartServers 50 MinSpareServers 10 MaxSpareServers 20 MaxClients 256 MaxRequestsPerChild 4000

is there any way to find out what the apache processes are stalled on?  
I think it might be related to some of my new code because it just  
started happening recently but I can’t reproduce it on demand.

i’m running ubuntu hardy 8.04. thanks!

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [August 7, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006/2 "2008-08-07T15:54:58Z")

</div>

Scott,

```
It is only recently that I have been playing with mod_rails, I

```

haven’t see such behavior yet.

```
Did the Rails log shows anything that could be associated to the

```

problem?

–  
Aníbal Rojas

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

On Aug 5, 9:11 pm, Scott K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [August 8, 2008, 3:49am UTC](https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006/3 "2008-08-08T03:49:55Z")

</div>

AnÃ­bal Rojas wrote:

> Scott,
> 
> ```
> It is only recently that I have been playing with mod_rails, I
> 
> ```
> 
> haven’t see such behavior yet.
> 
> ```
> Did the Rails log shows anything that could be associated to the
> 
> ```
> 
> problem?
> 
> –  
> Anï¿½bal Rojas  
> [http://hasmanydevelopers.com](http://hasmanydevelopers.com)  
> [http://rubycorner.com](http://rubycorner.com)  
> [http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)
> 
> On Aug 5, 9:11ï¿½pm, Scott K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

there were no errors until after i killed the processes…then i could  
see which page received a sigterm before it finished loading…but i  
could not reproduce the result. it seemed to happen randomly.

i just switched to nginx + thin server last night and everything is  
working great so far…and using less memory!

i think it may be a bug in mod\_rails.

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [August 8, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/apache-processes-occassionaly-hanging-under-mod-rails/145006/4 "2008-08-08T12:51:51Z")

</div>

I only use Apache when some of its mods or PHP is required. Otherwise  
I stick to your mix: Nginx + Thin, it is a much lighter and simple  
solution. Anyway it would be interesting gathering more information  
regarding your problem as mod\_rails looks promising.

* * *

Anibal

On Aug 8, 8:49 pm, Scott K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
