# [SOLVED] apache hangs after reloading a few pages

## Gabriel_Blake

Hello.

I had apache setup on my laptop, because from time to time I do some php web projects. I recently started a project after a 5 month break and discovered that my apache is very buggy. My system is up to date and my kernel is 3.0.6 (gentoo).

The server starts normally. It operates php pages normally. However, after loading a couple of pages (different ones or reloading the same page) the server stops responding (the page loading takes forever). Then I have to restart apache - I have to run "/etc/init.d/apache2 stop" at least 2 times to make it work. When I start it once more it operates normally for the first couple of pages and hangs again. 

I've tried reverting to previous versions (down to 2.2.17), but it didn't help.

The configs are set by etc-updage to the appropriate version.

The worst thing is that the logs show NOTING unusual.

I'll try to emerge it with the "debug" flag, maybe it'll show some new logs, but for now: do you have any ideas what could be the problem ?

PS Is it normal that apache runs in 4 instances (processes) ? I do have a Core i3 (4 logical cores).

PPS The debug showed no new info in /var/log/apache2Last edited by Gabriel_Blake on Mon Dec 12, 2011 10:55 pm; edited 4 times in total

----------

## audiodef

I've never seen apache have more than one process on my multi-core systems. 

What happens if you downgrade your kernel?

----------

## Hu

When Apache hangs, what is it doing?  Is it spinning?  Is it sleeping?  If it spins, is it making any system calls?  If it sleeps, what are the last calls it makes before it sleeps?

----------

## audiodef

Hu, you make it sound like Apache is either lazy or drunk.   :Razz: 

----------

## Gabriel_Blake

The same on old kernel :/

When apache hangs, it looks like this:

- the browser doesn't timeout (as it apache is responding, but not sending anything)

- the processor isn't loaded by apache (not a loop or anything)

- each of the 4 apache instances consumes around or less than 1% of my 4GB of RAM (not a memory leak)

Additionally:

- when I kill or stop apache it takes a while to die/stop.

- if i use -sKILL it dies instantly

- if I kill it and quickly hit "/etc/init.d/apache2 restart" the server hangs again after 1-2 page refreshes

- if i wait a moment between kill and restart, the server hangs after 3-6 page refreshes (so maybe a cache problem or something)

----------

## audiodef

By the way, the convention we use here calls for adding [SOLVED] to solved threads, but not to add [UNSOLVED] - that's implied unless marked with [SOLVED].   :Wink: 

----------

## Gabriel_Blake

I know... just trying to get people's attention  :Smile: 

Anyway... I solved the problem... It was... unusual.

I'm fusing the Symfony Web Framework (1.4) for my web apps. It requires a bunch of modules to be installed with Php and Apache. This behavior was caused by the lack of USE="xsl" in dev-lang/php. (even though it says that xsl is optional for Symfony).

But still... no logs in Apache nor Symfony showed that something might be wrong.

Thanks for you attention  :Smile: 

----------

## Gabriel_Blake

I'm back... because so is the problem.

It wasn't my framework's fault after all... now apache won't start at all  :Exclamation:  I just get this all the time:

```
apache2               | * Stopping apache2 ...

apache2               |apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

apache2               |httpd (pid 24868?) not running                                                                                                               [ ok ]

apache2               | * Starting apache2 ...

apache2               |apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 
```

It doesn't not show up in "ps -A".

I've realized that when apache was hanging previously, it only happened on the development environment in my framework ? is that any clue ?

---EDIT---

Cleaning semaphores helped... I don't know how they work (yet) but "ipcs -s" looked like a mess.

----------

