tuxguroo

Member
Aug 28, 2006
5
0
151
Hello ,

It has been 3 weeks since i am experiencing this problem. Httpd is going down every day . The server is not over loaded as it has only 160 domains hosted. I have installed mod security and have also set advanced rules , but it's still happening. Please help me with this ..
 

ujr

Well-Known Member
Mar 19, 2004
290
0
166
what are your logs telling you?

try also /sbin/service httpd configtest
 

moogle

Well-Known Member
Apr 7, 2003
94
0
156
What is your MaxClients set to?
# grep MaxClients /usr/local/apache/conf/httpd.conf

Around the time you see that apache might be going down (like if it does it every 30 mins) how many connections are there?
# ps axf|grep httpd|wc -l
 

ujr

Well-Known Member
Mar 19, 2004
290
0
166
Okay, 150 is the default MaxClients...

How many visitors are you getting with what moogle suggested?

Are you seeing any syntax or other errors in your logs related to httpd?
 

ujr

Well-Known Member
Mar 19, 2004
290
0
166
Also check /var/log/messages for errors at the time httpd dies.

I have a feeling it may be related to an httpd.conf error, so make sure it's all correct.
 

moFBush

Well-Known Member
Dec 31, 2005
51
0
156
Manuel_accu said:
delete resources of apache semaphore arrays from memory:

# ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print`ipcrm sem $a[1]`}'

then try to restart your httpd server

thx,
What does that do? In Enligsh?
 

Manuel_accu

Well-Known Member
Jun 19, 2005
191
0
166
Hi,

Its related to inter process communication, Apache create semaphore array in memory segment, sometimes when you have large number of semaphore array in memory for apache user then it is restarting automatically as new array or cant get the proper memory location to work/ for apache deamon.

ipcs provides information on the ipc facilities for which the calling process has read acccess.

However, if you are unsure for using this command you can get the list of semaphore in memory using below mentiond command.

# ipcs -s
------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 29360128 apache 600 1
0x00000000 29392897 apache 600 1
0x00000000 29425666 apache 600 1
0x00000000 29458435 apache 600 1
0x00000000 29491204 apache 600 1
0x00000000 29523973 apache 600 1
0x00000000 29556742 apache 600 1
0x00000000 29589511 apache 600 1
Here, we see a 8 message queue, all are used by apache users and has permission of 600 rw-rw-rw- "The nsems column os the ipcs command when used with the -s switch indicates the number of semaphores in each semaphore array created in a shared memory segment"


You can get the maximum nuber of semaphore kernel can have using below mentioned command.

# cat /proc/sys/kernel/sem
250 32000 32 128
the last colum "128" is the maximum number of semaphore kernel can have or it will crash.


ipcs -q: Show only message queues
ipcs -s: Show only semaphores
ipcs -m: Show only shared memory
ipcs --help: Additional arguments

The ipcrm command can be used to remove an IPC object from the kernel, for further information about this you can check the tlpd - linux documentation.

Regards,