Skip to main content

A lot of connections increase cpu ... server fall

Comments

11 comments

  • MaestriaNick
    Can you please check the output of command "top" at that time ? That will show what processes / user causing high load in the server.
    0
  • cPanelMichael
    Hello :) How much is the CPU increasing? Are the sites loading slower, and what type of content do the websites use? Are they MySQL-based websites? Thank you.
    0
  • LeroanZ
    I m sorry about my bad english firstly :) Yes Mysql Based web sites, of course php :) now for example i have a web site xxx.com and i open it on browser. When i press the F5 button till 10 seconds are enough and sites give error php error and after 10 seconds, cpu down and all server is down... when i see the top command when this action, it shows PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7622 aykut72 20 0 76496 38m 13m R 22.0 1.3 0:05.36 httpd therefore, a little hack tool or ip flood tools are very effective on my sites :)
    0
  • LeroanZ
    [quote="cPanelMichael, post: 1462792">Hello :) How much is the CPU increasing? Are the sites loading slower, and what type of content do the websites use? Are they MySQL-based websites? Thank you.
    In Addition, Before i use suphp this action down Mysql, i had to use this command after this actions: server mysql restart... i turned dso and it just led to php error and when i stop the flood, 10 seconds later it comes itself again...
    0
  • quizknows
    This is most likely not a server problem, but a problem with your PHP code or MySQL queries causing them to create high load on the server. You need to troubleshoot your application code. You may be able to try things like enabling a slow query log for MySQL or various tricks to analyze the PHP scripts. However this is most likely not security related, nor server related.
    0
  • LeroanZ
    No man, it happens on all web sites... and there is a different server i have my friend is using it, same problem in there... how can i fix it
    0
  • quizknows
    I'd start with the apache error log and any php error_log files. You mention VPS hosting, perhaps your server just does not have enough resources for dynamic PHP/MySQL sites. Even common CMS software like wordpress/joomla requires a pretty decent server nowadays. If you are using CMS software, look into caching plugins. Still this is not a security issue. While it is possible your server may be mis-configured, given your descriptions, it is far more likely that either your code for your sites is too load intensive, has bad SQL queries, or your server does not have enough resources to run the code for multiple visitors. While more RAM and CPU may help in the short term you need to optimize your site code and SQL queries. You could watch mysql queries from a ssh terminal while loading the pages to see if that is the cause, with a command like this as root: watch -n 1 mysqladmin proc
    0
  • LeroanZ
    yes i use generally cms, there is no problem other services. when i watch via this command, and press button f5 more... there are a lot of lines in there, but i can't copy here because it goes immediatly
    0
  • quizknows
    That's a good thing, that means your SQL queries are likely completing quickly. At that point look at the PHP code. Perhaps use a tool like [url=http://www.xdebug.org/docs/profiler]Xdebug: Documentation
    0
  • LeroanZ
    [quote="quizknows, post: 1464531">That's a good thing, that means your SQL queries are likely completing quickly. At that point look at the PHP code. Perhaps use a tool like [url=http://www.xdebug.org/docs/profiler]Xdebug: Documentation
    how can i do this i have a vps, what is this? plugin for php ?
    0
  • Aaron.Edwards
    Can you check the below and post here ? # free -m # grep KeepAlive /usr/local/apache/conf/httpd.conf # grep StartServers /usr/local/apache/conf/httpd.conf # grep MaxClients /usr/local/apache/conf/httpd.conf # grep MaxRequestsPerChild /usr/local/apache/conf/httpd.conf # netstat -tun | awk '{print $6}' | sort | uniq -c | sort -n # netstat -nut | awk '{print $4}' |grep ':80' | wc -l
    0

Please sign in to leave a comment.