ksoftirqd/1 占CPU较高, Mysql无故重启或直接挂

定期马甲 发布于 2013/01/29 09:37
阅读 3K+
收藏 0
  1. [root@AY130106044211d933870 /]# top
  2. top - 09:38:43 up 10 days, 20:01,  1 user,  load average: 5.07, 6.04, 5.50
  3. Tasks: 245 total,   2 running, 243 sleeping,   0 stopped,   0 zombie
  4. Cpu(s):  2.5%us,  1.2%sy,  0.0%ni, 81.5%id, 14.5%wa,  0.2%hi,  0.1%si,  0.0%st
  5. Mem:   1535236k total,  1462440k used,    72796k free,        0k buffers
  6. Swap:   490488k total,   489968k used,      520k free,     7600k cached
  7.   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  8.     9 root      20   0     0    0    0 S 12.8  0.0   1263:24 ksoftirqd/1
  9.    40 root      20   0     0    0    0 S  3.7  0.0 211:39.42 kswapd0
  10. 16261 www       20   0  214m 8564 2680 R  3.7  0.6   0:21.40 php-fpm
  11.  6989 www       20   0  222m  10m 2588 S  1.8  0.7   0:37.11 php-fpm
  12. 17782 www       20   0  229m  11m 2572 S  1.8  0.7   0:31.81 php-fpm
  13. 25638 root      20   0 15152 1296  876 R  1.8  0.1   0:00.01 top
  14. 26356 www       20   0  225m 9432 2572 S  1.8  0.6   0:41.06 php-fpm
  15.     1 root      20   0 19220   12    8 S  0.0  0.0   0:02.11 init
  16.     2 root      20   0     0    0    0 S  0.0  0.0   0:00.02 kthreadd
  17.     3 root      RT   0     0    0    0 S  0.0  0.0   0:07.45 migration/0
  18.     4 root      20   0     0    0    0 S  0.0  0.0   0:43.11 ksoftirqd/0
  19.     5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
  20.     6 root      RT   0     0    0    0 S  0.0  0.0   0:02.30 watchdog/0
  21.     7 root      RT   0     0    0    0 S  0.0  0.0   0:05.83 migration/1
  22.     8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/1
  23.    10 root      RT   0     0    0    0 S  0.0  0.0   0:02.68 watchdog/1
  24.    11 root      20   0     0    0    0 S  0.0  0.0   0:41.15 events/0
  25.    12 root      20   0     0    0    0 S  0.0  0.0   1:04.02 events/1
  26.    13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cgroup
  27.    14 root      20   0     0    0    0 S  0.0  0.0   0:34.34 khelper
  28.    15 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
  29.    16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr


  1. [root@AY130106044211d933870 /]# ps aux | grep mysql
  2. root     25772  0.0  0.0  11304   460 pts/0    S    09:39   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data/ --pid-file=/usr/local/mysql/data/mysql.pid
  3. mysql    26295  0.4  2.4 563772 36968 pts/0    Sl   09:40   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/log/error.log --pid-file=/usr/local/mysql/data/mysql.pid --port=3306
  4. root     27003  0.0  0.0 103236   688 pts/0    D+   09:43   0:00 grep mysql

2G内存,如今连swap也快用完。

放置两个站点,蜘蛛访问量一天估计过10万,用户访问2000以内。

本地mysql数据库还未使用,打算与另一主机建mysql主从同步。

mysql数据库部分日志

  1. 130108 14:40:30 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/
  2. 130108 14:40:30 [Warning] option 'slow_query_log': boolean value 'On;' wasn't recognized. Set to OFF.
  3. 130108 14:40:30 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
  4. 130108 14:40:30 [ERROR] Fatal error: Can't change to run as user 'mysql' ;  Please check that the user exists!
  5. 130108 14:40:30 [ERROR] Aborting
  6. 130108 14:40:30 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
  7. 130108 14:40:30 mysqld_safe mysqld from pid file /usr/local/mysql/data//AY130106044211d933870.pid ended
  8. 130108 14:52:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/
  1. 130128 19:41:21 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
  2. Version: '5.5.22-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
  3. 130128 19:41:51 mysqld_safe Number of processes running now: 0
  4. 130128 19:41:51 mysqld_safe mysqld restarted
  5. 130128 19:41:54 [Warning] option 'slow_query_log': boolean value '0;' wasn't recognized. Set to OFF.
  6. 130128 19:41:54 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
  7. 130128 19:41:54 [Warning] You need to use --log-bin to make --binlog-format work.
  8. 130128 19:41:54 InnoDB: The InnoDB memory heap is disabled
  9. 130128 19:41:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  10. 130128 19:41:54 InnoDB: Compressed tables use zlib 1.2.6
  11. 130128 19:41:55 InnoDB: Initializing buffer pool, size = 128.0M
  12. 130128 19:41:55 InnoDB: Completed initialization of buffer pool
  13. 130128 19:41:55 InnoDB: highest supported file format is Barracuda.
  14. 130128 19:41:55 InnoDB: 1.1.8 started; log sequence number 1595675
  15. 130128 19:41:56 [Note] Slave SQL thread initialized, starting replication in log 'mysql-synbin.000002' at position 133510043, relay log '/usr/local/mysql/data/log/mysql-relay-bin.000068' position: 153556
  16. 130128 19:41:56 [Note] Slave I/O thread: connected to master 'slave@121.120.111.11:3306',replication started in log 'mysql-synbin.000002' at position 133510043
  17. 130128 19:41:56 [Note] Event Scheduler: Loaded 0 events
  18. 130128 19:41:56 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
  19. Version: '5.5.22-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
  20. 130128 19:42:15 mysqld_safe Number of processes running now: 0
  21. 130128 19:42:15 mysqld_safe mysqld restarted
  22. 130128 19:42:17 [Warning] option 'slow_query_log': boolean value '0;' wasn't recognized. Set to OFF.
  23. 130128 19:42:17 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
  24. 130128 19:42:17 [Warning] You need to use --log-bin to make --binlog-format work.
  25. 130128 19:42:17 InnoDB: The InnoDB memory heap is disabled
  26. 130128 19:42:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  27. 130128 19:42:17 InnoDB: Compressed tables use zlib 1.2.6
  28. 130128 19:42:17 InnoDB: Initializing buffer pool, size = 128.0M
  29. 130128 19:42:17 InnoDB: Completed initialization of buffer pool
  30. 130128 19:42:18 InnoDB: highest supported file format is Barracuda.
  31. 130128 19:42:19 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended


问  :

    php-fpm 开多少个进程合理?

    mysql自动重启,还有直接挂,是否是内存有关? 还是与my.cnf配置与关?

    ksoftirqd/1 占CPU较高,估计前两个没事了。它也下降了吧。

问的有点太不确切了,还请多提些意见!!!

@红暑 写帖了提交后,怎么粘贴的图片无法保存啊。


加载中
返回顶部
顶部