PDA

Bekijk Volledige Versie : Mysqld hoge load



cwf
23/06/06, 14:37
Dag WHT-ers,

Wederom een topic over hoge load van mysqld, maar ik kom er maar niet uit.

Op sommige momenten schiet mijn load ineens omhoog naar 20+ en een hoog CPU %. Websites & SSH zijn/is nauwelijks tot niet te benaderen.

Mijn mysqld logs:



060608 0:19:50 [Note] /usr/sbin/mysqld: Shutdown complete

060608 00:19:50 mysqld ended

060608 00:21:54 mysqld started
060608 0:21:54 [Warning] Asked for 196608 thread stack, but got 126976
/usr/sbin/mysqld: ready for connections.
Version: '4.1.10a-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)
060608 0:22:20 [Note] /usr/sbin/mysqld: Normal shutdown

060608 0:22:20 [Note] /usr/sbin/mysqld: Shutdown complete

060608 00:22:20 mysqld ended

060608 00:22:26 mysqld started
060608 0:22:26 [Warning] Asked for 196608 thread stack, but got 126976
/usr/sbin/mysqld: ready for connections.
Version: '4.1.10a-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)
060623 13:43:12 [Note] /usr/sbin/mysqld: Normal shutdown

060623 13:43:14 [Note] /usr/sbin/mysqld: Shutdown complete

060623 13:43:15 mysqld ended

060623 13:47:28 mysqld started
060623 13:47:28 [Warning] Asked for 196608 thread stack, but got 126976
/usr/sbin/mysqld: ready for connections.
Version: '4.1.10a-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)
060623 14:01:35 [Note] /usr/sbin/mysqld: Normal shutdown

060623 14:01:35 [Note] /usr/sbin/mysqld: Shutdown complete

060623 14:01:35 mysqld ended

060623 14:01:36 mysqld started
060623 14:01:36 [Warning] Asked for 196608 thread stack, but got 126976
/usr/sbin/mysqld: ready for connections.
Version: '4.1.10a-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)
060623 14:10:06 [Note] /usr/sbin/mysqld: Normal shutdown

060623 14:10:07 [Note] /usr/sbin/mysqld: Shutdown complete

060623 14:10:07 mysqld ended

060623 14:16:16 mysqld started
060623 14:16:16 [Warning] Asked for 196608 thread stack, but got 126976
/usr/sbin/mysqld: ready for connections.
Version: '4.1.10a-standard-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)


Iemand tips hoe ik kan uitzoeken wie of wat dit veroorzaakt?

Mijn dank is groot! :)

It-Biz
23/06/06, 15:08
Instellingen van /etc/my.cnf controleren/aanpassen

cwf
23/06/06, 16:05
Instellingen van /etc/my.cnf controleren/aanpassen

Lijkt me dat het handiger is om te zien waar het vandaan komt ;)

WilloW
23/06/06, 16:18
Lijkt me dat het handiger is om te zien waar het vandaan komt ;)


Post je my.cnf eens... probleem heeft te maken met geheugen misschien dat je ergens in je config een vreemde waarde meegeeft

cwf
23/06/06, 16:46
Hierbij.

Alvast bedankt!!

top



top - 16:41:40 up 36 days, 18:14, 1 user, load average: 0.76, 0.54, 0.42
Tasks: 140 total, 1 running, 139 sleeping, 0 stopped, 0 zombie
Cpu(s): 20.6% us, 10.3% sy, 0.0% ni, 68.5% id, 0.0% wa, 0.6% hi, 0.0% si
Mem: 1034980k total, 864044k used, 170936k free, 54076k buffers
Swap: 2031608k total, 11384k used, 2020224k free, 585704k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18247 mysql 16 0 69936 36m 5248 S 9.6 3.6 0:29.42 mysqld
17786 mysql 17 0 69936 36m 5248 S 8.7 3.6 0:32.65 mysqld
18236 mysql 17 0 69936 36m 5248 S 3.9 3.6 0:45.08 mysqld
21630 apache 15 0 36464 25m 19m S 2.9 2.6 0:00.09 httpd
21624 apache 15 0 34976 24m 19m S 1.9 2.4 0:00.09 httpd
20732 apache 15 0 37976 27m 19m S 0.6 2.7 0:03.37 httpd
21629 apache 15 0 34972 24m 19m S 0.6 2.4 0:00.02 httpd
20735 apache 15 0 36124 25m 19m S 0.3 2.5 0:03.65 httpd
20751 apache 15 0 38676 27m 19m S 0.3 2.8 0:03.14 httpd
21616 root 16 0 1932 992 1684 R 0.3 0.1 0:00.06 top
1 root 16 0 3132 452 1424 S 0.0 0.0 0:31.03 init
2 root 34 19 0 0 0 S 0.0 0.0 0:02.63 ksoftirqd/0
3 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 events/0
4 root 6 -10 0 0 0 S 0.0 0.0 0:00.00 khelper
5 root 5 -10 0 0 0 S 0.0 0.0 0:00.08 kblockd/0
51 root 13 -10 0 0 0 S 0.0 0.0 0:00.00 aio/0
6 root 15 0 0 0 0 S 0.0 0.0 0:00.00 khubd
46 root 15 0 0 0 0 S 0.0 0.0 0:00.08 kapmd
50 root 16 0 0 0 0 S 0.0 0.0 11:48.52 kswapd0
123 root 25 0 0 0 0 S 0.0 0.0 0:00.00 kseriod
193 root 5 -10 0 0 0 S 0.0 0.0 0:00.00 ata/0
195 root 22 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
196 root 23 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
207 root 6 -10 0 0 0 S 0.0 0.0 0:00.00 kmirrord/0
216 root 15 0 0 0 0 S 0.0 0.0 13:02.71 kjournald
1100 root 6 -10 1684 16 1352 S 0.0 0.0 0:00.00 udevd
1504 root 15 0 0 0 0 S 0.0 0.0 0:00.00 kjournald
2152 root 15 0 2780 336 1360 S 0.0 0.0 0:43.83 syslogd
2156 root 16 0 1632 124 1304 S 0.0 0.0 0:00.00 klogd
2182 rpc 15 0 2816 156 1436 S 0.0 0.0 0:00.00 portmap
2201 rpcuser 18 0 1800 20 1476 S 0.0 0.0 0:00.00 rpc.statd
2231 root 16 0 4364 76 3648 S 0.0 0.0 0:00.33 rpc.idmapd
2261 root 16 0 2984 20 1304 S 0.0 0.0 0:00.00 apmd
2300 root 15 0 2224 256 1476 S 0.0 0.0 0:00.42 smartd
2383 root 16 0 2816 380 1748 S 0.0 0.0 0:04.37 xinetd
2425 root 16 0 2648 32 1504 S 0.0 0.0 0:00.00 gpm
2517 root 16 0 2452 80 1380 S 0.0 0.0 0:09.44 vm-pop3d
2607 root 16 0 1896 164 1464 S 0.0 0.0 0:00.03 atd
2622 dbus 16 0 2736 152 2068 S 0.0 0.0 0:00.02 dbus-daemon-1
2637 root 16 0 8044 1312 3072 S 0.0 0.1 0:06.16 hald
2645 root 18 0 2100 20 1296 S 0.0 0.0 0:00.00 mingetty
2646 root 18 0 2884 20 1296 S 0.0 0.0 0:00.00 mingetty


my.cnf




[mysqld]
datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=350
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=10M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
log-bin
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
#pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=10M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout


servers specs



Amd athlon 3000+
1024 DDR
2 x 160 GB

wonko
23/06/06, 17:28
Als de server traag is, ga dan eens in mysql, en tik daar "show full processlist", en doe dit enkele malen naeen.

Anders eens slow query log opzetten, of kijken naar het aantal open files, en het aantal open tabellen... Even googlen, en je vindt wel wat...

ErikKosters
23/06/06, 18:22
die load zoals hij daar nu is kan soms wel voorkomen, niets ernstigs.. maar inderdaad ff slow query log opzetten. Dan kom je er wel achter.

Danny Mekic
23/06/06, 22:54
Welke versie van MySQL draai je?

cwf
23/06/06, 23:41
Welke versie van MySQL draai je?

MySQL 4.1.10a :)

@ Wonko & Erik: zal ik zeker even proberen.

Thnx!


Als de server traag is, ga dan eens in mysql, en tik daar "show full processlist", en doe dit enkele malen naeen.

Anders eens slow query log opzetten, of kijken naar het aantal open files, en het aantal open tabellen... Even googlen, en je vindt wel wat...

- ''show full processlist'' uitkomst is niets...

- Onderstaande toegevoegd aan /etc/my.cnf. mysql-slow.log bestaat alleen niet. Misschien wordt het pas aangemaakt als er iets gelogd wordt?


log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 1

- mysql > SHOW STATUS LIKE 'Opened_tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Opened_tables | 164 |
+---------------+-------+
1 row in set (0.00 sec)



Any tips? Dankjewel!

cwf
26/06/06, 13:47
Meer geheugen in prikken misschien?

djalken
26/06/06, 13:55
misschien een idee om key_buffer=16M iets groter te maken?

Domenico
26/06/06, 13:56
Probeer het even te monitoren met MyTop.

Er is nu naast de console versie ook een web (AJAX) versie.
http://www.thehouse.net/2006/02/03/mysql-monitor-ajaxified/


I use a MySQL database in most, if not all, my website development projects. In some cases, especially with applications/sites that tend to get a large number of hits (and as such, a greater number of interactions with the database), it’s nice to be able to see what the DB engine is doing, how many threads are running, etc. My tool of choice has been MyTop by Jeremy Zawodny for a couple years now. Recently, it looks like someone wanting to learn some Ajax has decided to port Jeremy’s great tool over to an ajaxified webpage! No need to login to the database server and run mytop in a console anymore; now I can do it straight from a web browser!

The project is called ajaxMyTop and is hosted on Sourceforge. Currently, there is no home page or details on the project website, but Ajaxian has a good review of the application.

One note of caution; the application is written for PHP5. There is a small modification available which will enable the application to run under PHP4. It’s located in the ajaxMyTop forums:

http://sourceforge.net/forum/forum.php?thread_id=1431063&forum_id=526557

Sites mentioned:

http://ajaxian.com/archives/779 - Ajaxian Review of ajaxMyTop
http://jeremy.zawodny.com/mysql/mytop/ - Jeremy Zawodny’s original mytop webpage
http://sourceforge.net/projects/ajaxmytop/ - ajaxMyTop Project Website

cwf
27/06/06, 14:50
Zou iemand voor mij even kunnen kijken [evt. tegen vergoeding]? Ik kom hier echt niet uit...

PM me als je bereidt bent om te helpen. Would be much appreciated!