Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having a few problems with my server. It is throwing up intermittant errors and running quite slow. Here is the output from top:

top - 07:33:33 up 18:57,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  90 total,   1 running,  82 sleeping,   7 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1048576k total,  1048576k used,        0k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

Ordered by %MEM:

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9597 root      16   0  276m  91m  15m S  0.0  8.9   0:29.38 java
 9564 tomcat    15   0  249m  34m  11m S  0.0  3.4   0:11.79 java
 9636 root      18   0 54804  24m 9784 S  0.0  2.4   0:02.58 httpd
26139 apache    15   0 57520  23m 5996 S  0.0  2.3   0:00.15 httpd
16264 apache    18   0 56984  23m 6104 S  0.0  2.2   0:00.21 httpd
24294 apache    15   0 57512  22m 5864 S  0.0  2.2   0:00.17 httpd
30231 apache    15   0 57272  22m 5748 S  0.0  2.2   0:00.97 httpd
32257 apache    15   0 57512  22m 5416 S  0.0  2.2   0:00.46 httpd
19947 apache    15   0 57512  22m 5320 S  0.0  2.2   0:00.19 httpd
26148 apache    15   0 56688  22m 5992 S  0.0  2.2   0:00.40 httpd
14039 apache    18   0 57000  22m 5492 S  0.0  2.2   0:00.33 httpd
 6051 apache    15   0 57736  22m 5128 S  0.0  2.2   0:00.07 httpd
19937 apache    15   0 56992  22m 5400 S  0.0  2.2   0:00.14 httpd
 5200 apache    15   0 56984  22m 5376 S  0.0  2.2   0:00.23 httpd
10001 apache    15   0 55636  21m 5636 S  0.0  2.1   0:01.05 httpd
11734 apache    15   0 56712  21m 4548 S  0.0  2.1   0:00.46 httpd
18193 apache    15   0 55100  20m 5508 S  0.0  2.0   0:00.24 httpd
14036 apache    15   0 55128  20m 5412 S  0.0  2.0   0:00.10 httpd
 3981 apache    15   0 55128  19m 4860 S  0.0  1.9   0:00.16 httpd
 7588 apache    18   0 55112  19m 4848 S  0.0  1.9   0:00.04 httpd
19768 apache    16   0 55112  19m 4844 S  0.0  1.9   0:00.02 httpd
 5827 apache    15   0 55112  19m 4828 S  0.0  1.9   0:00.05 httpd
29774 apache    15   0 55112  19m 4544 S  0.0  1.9   0:00.11 httpd
 6064 apache    15   0 55112  19m 4536 S  0.0  1.9   0:00.02 httpd
16253 apache    17   0 55116  19m 4532 S  0.0  1.9   0:00.01 httpd
19922 apache    15   0 55112  19m 4540 S  0.0  1.9   0:00.02 httpd
10010 apache    15   0 55100  19m 4524 S  0.0  1.9   0:00.01 httpd
18195 apache    18   0 55104  18m 3872 S  0.0  1.8   0:00.02 httpd
 7361 mysql     15   0  134m  18m 6400 S  0.0  1.8   0:10.18 mysqld
19921 apache    15   0 55088  18m 3588 S  0.0  1.8   0:00.02 httpd
11967 apache    15   0 55080  18m 3584 S  0.0  1.8   0:00.00 httpd
13813 apache    15   0 55088  18m 3576 S  0.0  1.8   0:00.14 httpd
23898 apache    18   0 54968  17m 3212 S  0.0  1.7   0:00.00 httpd
13792 apache    15   0 54968  17m 3088 S  0.0  1.7   0:00.00 httpd
14083 apache    15   0 54968  17m 3088 S  0.0  1.7   0:00.00 httpd
32547 apache    15   0 54944  17m 2924 S  0.0  1.7   0:00.00 httpd
13787 apache    15   0 54944  17m 2908 S  0.0  1.7   0:00.00 httpd
 3623 apache    17   0 54944  17m 2908 S  0.0  1.7   0:00.00 httpd
16024 apache    19   0 54944  17m 2860 S  0.0  1.7   0:00.00 httpd
13791 apache    15   0 54944  17m 2864 S  0.0  1.7   0:00.00 httpd
20090 named     19   0  110m 4244 2056 S  0.0  0.4   0:01.55 named
 9369 cyrus     15   0 15904 3048 1720 S  0.0  0.3   0:00.24 cyrus-master
32735 root      15   0  8852 2888 2116 T  0.0  0.3   0:00.00 mysql

The intermittant error I get using Firefox is:

  Server not found

Firefox can't find the server at XXXXXXX.co.

    *   Check the address for typing errors such as
          ww.example.com instead of
          www.example.com

    *   If you are unable to load any pages, check your computer's network
          connection.

    *   If your computer or network is protected by a firewall or proxy, make sure
          that Firefox is permitted to access the Web.

And on other browsers, the page just loads for about 10 minutes but never appears. The only way to resolve it is to close the browser completely as the error appears to be saved in the cache.

Has anyone got any ideas?

Many Thanks.

share|improve this question
    
how many http processes do you have? please run ps aux | grep http | wc -l –  AliGibbs Feb 8 '11 at 14:40
    
Hi AliGibbs, it returned 40. –  KitCarrau Feb 8 '11 at 14:48
    
40 × about 20mb each = most of your RAM right there. –  mattdm Feb 8 '11 at 15:01
    
I have just restarted httpd and it has gone down to 6. What could be causing those additional processes? –  KitCarrau Feb 8 '11 at 15:04

2 Answers 2

up vote 4 down vote accepted

For a server with only 1gb of ram, you should definitely be scaling back the number of httpd processes you have running (try a startup of 4 and a max of 12). You also need to turn on swap as the OOM killer is probably having all sorts of fun on that box which is no doubt causing lots of issues.

In apache, StartServers controls the number of servers to start, and MaxClients controls the max number of processes. For swap, you will need to create a swap partition, run mkswap on it, put it in your fstab, and then run swapon -a. Your distribution probably has a walkthrough you can follow.

share|improve this answer
    
Hi Patrick, thanks for the reply. I am not too sure where all of the httpd processes are coming from. What's the best way to find out? Also, how do I turn on/find out for info on swap? Thanks, Chris. –  KitCarrau Feb 8 '11 at 14:55
    
1) Look in your apache configuration, /etc/httpd/conf/httpd.conf. Configuring that properly is actually a whole 'nuther question. –  mattdm Feb 8 '11 at 14:59
    
2) /etc/fstab, probably. Again, really a whole separate question, and probably best on unix.stackexchange.com –  mattdm Feb 8 '11 at 15:00
    
Thanks for the updates. The above helped me get to the bottom of the issue which is detailed below. –  KitCarrau Feb 9 '11 at 9:26

Thank you for the responses. I have found the cause of the error.

We are using Pear Mailer which uses a queue to stack emails ready for sending with a cron job. There was an error in the Pear script which was being called on every action on our site (making posts, sending messages etc..). Pear was crashing which in turn crashed the browser resulting in the above errors.

Disabling Pear resolved the problem, and tweaking the code got it working again.

The multiple httpd processes were being caused by failed instances of Pear Mailer. It took so long to find the issue as we never thought Pear Mailer could cause such a response.

Thanks again for your help.

Chris.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.