[Ilugc] server load

  • From: codeshepherd@xxxxxxxxx (Deepan Chakravarthy)
  • Date: Wed Jun 18 12:18:51 2008

Raja Subramanian wrote:

On Mon, Jun 16, 2008 at 12:22 PM, Deepan Chakravarthy
<codeshepherd@xxxxxxxxx> wrote:
  
     I have noticed huge spikes in server load recently.   Load average
sometimes hits 50.0 ; however after removing unwanted mail alerts from cron
load has dropped to  2.0 to 5.0;    I guess even 2.0 is a high load for the
kind of usage I have.   Mysqld seems to top in CPU usage.
mysqladmin processlist  always reports a dead thread. How do I flush these
dead threads ?
    

Optimize your SQL queries and tables.  "SELECT * FROM foo" is never good
practice as it may force a full table scan and cause heavy disk IO.  The slow
query log can help you identify the hot spots.  Google "mysql slow queries".

If you have large tables this is a really painful problem.  I used to run
Request Tracker with a +25GB MySQL 4.x backend.  Complex RT searches
could send MySQL spinning forever.  Over time we learnt to tune our tables
and sanitize user queries.  Many times the only way out was to simply restart
MySQL.

Btw, don't forget to check the MySQL bug tracker for any solutions/patches.

  

Thanks Raja,
 I had enabled slow query tracking.  btw.. I have noticed the following 
errors , they pop up  three to five times in a  day... in a program that 
is being run every three seconds ..



PHP Warning:  mysql_connect(): Lost connection to MySQL server at 
'sending authentication information', system error: 32 in


Did google for the above problem..  looks like lot of other sites have 
these problem and they show up in google results.. 

They occur at the following line of code.

  $this->connfb = mysql_connect($this->dbhost, $this->dbuser, 
$this->dbpass) or die ('Error connecting to mysql');




Other related posts: