The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Sleeping..load issues

Discussion in 'General Discussion' started by DigiCrime, Jul 24, 2006.

  1. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    Question on MySQL sleeping..

    25803 mysql 9 0 454M 422M 11728 S 0.1 20.9 36:53 0 mysqld
    25817 mysql 9 0 454M 422M 11728 S 0.1 20.9 44:34 2 mysqld
    19169 mysql 9 0 454M 422M 11728 S 0.1 20.9 42:36 0 mysqld

    Even though its in sleep mode but the CPU usage is up a little bit does thos not cause the load to rise even though mysql isnt doing anything at the moment?

    What causes so many of them? And what causes it to stay stuck in sleep mode for so long.

    Lastly, is it normal to have a few or several running but nothing in the process list except exim stats at the time I looked at top.
     
  2. ramprage

    ramprage Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    667
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    Is there lots of activity if you try:
    mysqladmin processlist from shell?
     
  3. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    Nope... heres right now top sorted by time this is a dual xeon with 2 gigs of ram with /home on a scsi drive btw

    Code:
    top
     13:37:32  up 7 days,  2:22,  1 user,  load average: 5.74, 5.36, 5.93
    215 processes: 205 sleeping, 5 running, 3 zombie, 2 stopped
    CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
               total   79.8%    0.1%   19.0%   0.0%     0.0%    0.0%    0.9%
               cpu00   69.9%    0.1%   29.2%   0.0%     0.0%    0.0%    0.6%
               cpu01   83.4%    0.0%   14.6%   0.0%     0.0%    0.0%    1.8%
               cpu02   84.5%    0.1%   14.0%   0.0%     0.0%    0.0%    1.2%
               cpu03   81.5%    0.1%   18.1%   0.0%     0.0%    0.0%    0.1%
    Mem:  2067468k av, 1996888k used,   70580k free,       0k shrd,  163488k buff
           515384k active,             698940k inactive
    Swap: 4096532k av,  149424k used, 3947108k free                  998388k cached
    
      PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
    18368 mysql      9   0  454M 423M 11996 S     0.0 20.9  57:02   2 mysqld
    10803 mysql      9   0  454M 423M 11996 S     1.4 20.9  54:36   2 mysqld
    22817 mysql      9   0  454M 423M 11996 S     0.0 20.9  53:20   0 mysqld
    18259 mysql      9   0  454M 423M 11996 S     0.0 20.9  52:39   0 mysqld
     9705 mysql      9   0  454M 423M 11996 S     0.0 20.9  51:46   0 mysqld
     9817 mysql      9   0  454M 423M 11996 S     0.0 20.9  50:36   3 mysqld
    18009 mysql      9   0  454M 423M 11996 S     0.0 20.9  50:12   3 mysqld
     9814 mysql      9   0  454M 423M 11996 S     0.0 20.9  49:27   3 mysqld
    22813 mysql      9   0  454M 423M 11996 S     0.0 20.9  49:22   1 mysqld
    12853 mysql      9   0  454M 423M 11996 S     0.0 20.9  49:01   1 mysqld
    12801 mysql      9   0  454M 423M 11996 S     0.0 20.9  49:00   0 mysqld
    22818 mysql      9   0  454M 423M 11996 S     0.0 20.9  48:56   1 mysqld
     9874 mysql      9   0  454M 423M 11996 S     0.0 20.9  48:35   0 mysqld
     1733 root      19  19 63200  27M 27232 S N   0.0  1.3  48:31   2 cpanellogd
    19038 mysql      9   0  454M 423M 11996 S     0.0 20.9  48:15   1 mysqld
     9704 mysql      9   0  454M 423M 11996 S     0.0 20.9  47:41   0 mysqld
     9660 mysql      9   0  454M 423M 11996 S     0.0 20.9  47:12   3 mysqld
     9858 mysql      9   0  454M 423M 11996 S     0.0 20.9  46:43   2 mysqld
    12852 mysql      9   0  454M 423M 11996 S     0.0 20.9  46:31   2 mysqld
    25808 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:55   2 mysqld
    19039 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:50   0 mysqld
    20092 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:37   1 mysqld
    25797 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:37   2 mysqld
    25817 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:12   2 mysqld
     9659 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:09   3 mysqld
    22822 mysql      9   0  454M 423M 11996 S     0.0 20.9  45:06   0 mysqld
    31526 mysql      9   0  454M 423M 11996 S     0.0 20.9  44:31   0 mysqld
    25809 mysql      9   0  454M 423M 11996 S     0.0 20.9  43:55   3 mysqld
    19168 mysql      9   0  454M 423M 11996 S     0.0 20.9  43:46   2 mysqld
    19169 mysql      9   0  454M 423M 11996 S     0.0 20.9  43:17   1 mysqld
    25717 mysql      9   0  454M 423M 11996 S     0.0 20.9  43:10   3 mysqld
    25812 mysql      9   0  454M 423M 11996 S     0.0 20.9  42:53   1 mysqld
    25711 mysql      9   0  454M 423M 11996 S     0.0 20.9  42:41   2 mysqld
    25713 mysql      9   0  454M 423M 11996 S     0.2 20.9  42:16   2 mysqld
     9734 mysql      9   0  454M 423M 11996 S     0.0 20.9  42:10   1 mysqld
    19171 mysql      9   0  454M 423M 11996 S     0.0 20.9  42:00   1 mysqld
    25810 mysql      9   0  454M 423M 11996 S     0.0 20.9  41:48   2 mysqld
    
    mysql
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 1140778 to server version: 4.1.19-standard

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> SHOW FULL PROCESSLIST;
    +---------+------------------+-----------+------------------+---------+------+-------+-----------------------+
    | Id | User | Host | db | Command | Time | State | Info |
    +---------+------------------+-----------+------------------+---------+------+-------+-----------------------+
    | 1140225 | eximstats | localhost | eximstats | Sleep | 2 | | NULL |
    | 1140778 | root | localhost | NULL | Query | 0 | NULL | SHOW FULL PROCESSLIST |
    | 1140792 | salmoncr_vforums | localhost | salmoncr_vforums | Sleep | 0 | | NULL |
    +---------+------------------+-----------+------------------+---------+------+-------+-----------------------+
    3 rows in set (0.00 sec)


    STATUS;
    --------------
    mysql Ver 14.7 Distrib 4.1.19, for pc-linux-gnu (i686) using readline 4.3

    Connection id: 1140778
    Current database:
    Current user: root@localhost
    SSL: Not in use
    Current pager: stdout
    Using outfile: ''
    Using delimiter: ;
    Server version: 4.1.19-standard
    Protocol version: 10
    Connection: Localhost via UNIX socket
    Server characterset: latin1
    Db characterset: latin1
    Client characterset: latin1
    Conn. characterset: latin1
    UNIX socket: /var/lib/mysql/mysql.sock
    Uptime: 7 days 2 hours 3 min 57 sec

    Threads: 4 Questions: 44725202 Slow queries: 1611 Opens: 80139 Flush tables: 1 Open tables: 2000 Queries per second avg: 73.052
     
    #3 DigiCrime, Jul 24, 2006
    Last edited: Jul 24, 2006
  4. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    No one have any ideas??
     
  5. RandyO

    RandyO Well-Known Member

    Joined:
    Jun 17, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    the offending user may have the "persistant connections" enabled in their config file. This setting I believe is more suited to remote db servers (saves the connection process every query). On a local box you end up with a bunch of sleeping process'
     
  6. DigiCrime

    DigiCrime Well-Known Member

    Joined:
    Nov 27, 2002
    Messages:
    399
    Likes Received:
    0
    Trophy Points:
    16
    that may not be to fun to track down I know vbulletin has this type of setting ive already checked all the vb accounts on the server none have this enabled
     
Loading...

Share This Page