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.

ubuntu 12.4 LTS, apache 2.2.14, mysql+wordpress on top.

server gets into serious load 70.0 69.9 67.0 just by scanning it with web application scanning tool, and becomes unresponsive. Easy DOS from single host so to speak. How to prevent this?

update:

here is what I see on top command, it seems a million instances of apache2 are running. How do I prevent this? How do I limit how many apache2 instances can run?

top - 08:58:58 up 10:22,  1 user,  load average: 160.39, 159.70, 158.99
Tasks: 297 total,   1 running, 296 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.9%sy,  0.0%ni, 29.0%id, 70.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    503420k total,   498456k used,     4964k free,      300k buffers
Swap:  1048568k total,  1048184k used,      384k free,     5432k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                        
 9333 www-data  20   0  167m 2860  680 D    0  0.6   0:05.18 apache2                                                                                                         
 2194 mysql     20   0  455m 3160  312 S    0  0.6   1:49.67 mysqld                                                                                                          
 9294 www-data  20   0  167m 2816  420 D    0  0.6   0:05.04 apache2                                                                                                         
 9337 www-data  20   0  167m 2892  360 D    0  0.6   0:05.42 apache2                                                                                                         
 9281 www-data  20   0  186m 3372  396 D    0  0.7   0:05.96 apache2                                                                                                         
 9313 www-data  20   0  167m 3012  564 D    0  0.6   0:05.64 apache2                                                                                                         
 9327 www-data  20   0  167m 3300  412 D    0  0.7   0:04.88 apache2                                                                                                         
 9395 www-data  20   0  167m 2540   76 D    0  0.5   0:04.97 apache2                                                                                                         
 9285 www-data  20   0  167m 2636  328 D    0  0.5   0:05.39 apache2                                                                                                         
 9297 www-data  20   0  167m 2420  528 D    0  0.5   0:04.89 apache2                                                                                                         
 9408 www-data  20   0  167m 2728   64 D    0  0.5   0:04.42 apache2                                                                                                         
   82 root      20   0     0    0    0 D    0  0.0   2:57.97 kswapd0                                                                                                         
  223 root      20   0     0    0    0 S    0  0.0   0:02.46 kjournald                                                                                                        9470 www-data  20   0  167m 3216  652 D    0  0.6   0:02.26 apache2                                                                                                         
 9502 smmsp     20   0 65772 1068  260 D    0  0.2   0:01.62 sendmail-msp                                                                                                    
 9303 www-data  20   0  167m 2800  432 D    0  0.6   0:05.24 apache2                                                                                                         
 9352 www-data  20   0  167m 2988  492 D    0  0.6   0:04.98 apache2                                                                                                         
 9351 www-data  20   0  167m 3144  560 D    0  0.6   0:04.57 apache2                                                                                                         
 9374 www-data  20   0  167m 3304  556 D    0  0.7   0:04.79 apache2                                                                                                         
 9411 www-data  20   0  167m 2888   60 D    0  0.6   0:03.81 apache2                                                                                                         
 9136 root      20   0 19368  652  256 R    0  0.1   0:06.73 top                                                                                                             
 9289 www-data  20   0  167m 3180  608 D    0  0.6   0:05.61 apache2                                                                                                          9298 www-data  20   0  167m 3312  564 D    0  0.7   0:05.59 apache2
share|improve this question

closed as not a real question by SmallClanger, Jay, MDMarra, EEAA, gWaldo Nov 3 '12 at 13:22

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers

You should check what Task generates this huge load on the server.

And then, if you got the task in question: Either configure it to limit the number of requests possible or limit access based on number of requests/ip-address.

share|improve this answer
add comment

It looks like you've completely exhausted physical RAM and are swapping furiously. Your top output shows almost 300 running processes, the bulk of which are Apache workers.

Look at this piece of the Apache documentation for configuring the maximum number or Apache processes. You will be looking at the MaxClients, ThreadsPerChild, and ServerLimit directives.

share|improve this answer
add comment

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