Forum

Monitor overloading the server

Aquanet
15 February 2013, 11:54
Hello Hugo,

Just wanted to let you know that on days when sites receive 200,000+ requests, monitor overloads the server, sometimes shows 500 error, sometimes does not process data properly. Needs mysql restarts to lower load.

load average: 7.42, 6.50, 6.17

Regards
Andrew
Hugo Leisink
15 February 2013, 14:53
How do you know it's the Monitor? Hiawatha caches Monitor information in memory and flushes it do disk when cache is full. A cronjob script downloads that information. I don't know the run interval you set for that script, but I really doubt that this can lead to a high load on your MySQL database. How do you know that the load is due to the Monitor?
Aquanet
15 February 2013, 18:02
Hello Hugo,

We allocated monitor a separate server, so there is nothing else there.
top - 17:01:56 up  7:35,  1 user,  load average: 8.72, 7.98, 7.73
Tasks: 330 total, 1 running, 329 sleeping, 0 stopped, 0 zombie
Cpu(s): 78.6%us, 2.6%sy, 0.0%ni, 6.0%id, 0.0%wa, 0.0%hi, 0.0%si, 12.7%st
Mem: 1548504k total, 1505384k used, 43120k free, 42612k buffers
Swap: 2097144k total, 320192k used, 1776952k free, 76684k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1169 mysql 20 0 318m 32m 3412 S 184 2.2 793:00.35 mysqld
1023 ntp 20 0 38464 1548 1432 S 1 0.1 0:03.74 ntpd
2744 root 20 0 173m 12m 7196 S 1 0.8 0:31.94 fetch_webserver
3470 root 20 0 172m 10m 7196 S 1 0.7 0:13.68 fetch_webserver
3776 root 20 0 172m 11m 7196 S 1 0.8 0:12.56 fetch_webserver
1 root 20 0 8356 656 632 S 0 0.0 0:00.84 init
2 root 15 -5 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/0
4 root 15 -5 0 0 0 S 0 0.0 0:00.08 ksoftirqd/0
5 root RT -5 0 0 0 S 0 0.0 0:01.96 watchdog/0
6 root 15 -5 0 0 0 S 0 0.0 0:02.50 events/0
7 root 15 -5 0 0 0 S 0 0.0 0:00.00 khelper
19 root 15 -5 0 0 0 S 0 0.0 0:00.00 xenwatch
20 root 15 -5 0 0 0 S 0 0.0 0:00.00 xenbus
25 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/1
26 root 15 -5 0 0 0 S 0 0.0 0:00.08 ksoftirqd/1
27 root RT -5 0 0 0 S 0 0.0 0:00.06 watchdog/1

Thanks
Andrew
Aquanet
15 February 2013, 18:19
I think the problem is in mysql connections, we increased it now, maybe it will help...

PHP Warning: mysql_connect(): Too many connections in /var/www/monitor/public/chart/requests.php
Aquanet
15 February 2013, 18:35
well, or not...
top - 17:35:10 up  8:08,  1 user,  load average: 77.32, 61.22, 34.89Tasks: 367 total,  80 running, 287 sleeping,   0 stopped,   0 zombie
Cpu(s): 64.3%us, 6.9%sy, 0.2%ni, 0.0%id, 0.0%wa, 0.0%hi, 2.1%si, 26.5%stMem: 1548504k total, 1535000k used, 13504k free, 3516k buffers
Swap: 2097144k total, 1420096k used, 677048k free, 148316k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 11420 mysql 20 0 328m 16m 3272 S 7 1.1 1:40.36 mysqld
4177 root 20 0 178m 17m 5936 R 3 1.2 0:35.62 fetch_webserver 4374 root 20 0 178m 17m 5936 R 3 1.2 0:35.34 fetch_webserver
4477 root 20 0 178m 17m 5936 R 3 1.2 0:33.62 fetch_webserver 4579 root 20 0 178m 17m 5936 R 3 1.1 0:33.84 fetch_webserver
4777 root 20 0 178m 17m 5936 R 3 1.1 0:32.98 fetch_webserver 5385 root 20 0 177m 17m 5936 R 3 1.2 0:28.20 fetch_webserver
6299 root 20 0 177m 17m 5936 R 3 1.2 0:27.56 fetch_webserver 6398 root 20 0 177m 17m 5936 R 3 1.2 0:26.74 fetch_webserver
7110 root 20 0 183m 17m 5936 R 3 1.2 0:25.94 fetch_webserver 8008 root 20 0 183m 13m 5944 R 3 0.9 0:20.58 fetch_webserver
8520 root 20 0 183m 29m 5944 R 3 1.9 0:20.04 fetch_webserver 8616 root 20 0 183m 13m 5944 R 3 0.9 0:22.18 fetch_webserver
9126 root 20 0 183m 13m 5944 R 3 0.9 0:21.16 fetch_webserver 9317 root 20 0 183m 13m 5944 R 3 0.9 0:21.12 fetch_webserver
9424 root 20 0 183m 29m 5944 R 3 1.9 0:19.56 fetch_webserver 9936 root 20 0 183m 13m 5944 R 3 0.9 0:20.62 fetch_webserver
11956 www-data 20 0 165m 16m 7188 R 3 1.1 0:00.20 php-cgi 11960 www-data 20 0 165m 15m 7140 R 3 1.1 0:00.18 php-cgi
2248 root 20 0 181m 18m 5936 R 2 1.2 1:29.44 fetch_webserver 2744 root 20 0 183m 13m 5936 S 2 0.9 0:49.25 fetch_webserver
3776 root 20 0 178m 17m 5936 R 2 1.2 0:38.25 fetch_webserver 2449 root 20 0 184m 13m 5936 S 2 0.9 1:02.98 fetch_webserver
2954 root 20 0 183m 13m 5936 S 2 0.9 0:41.09 fetch_webserver 3676 root 20 0 179m 17m 5936 R 2 1.2 0:42.44 fetch_webserver
4068 root 20 0 178m 17m 5936 R 2 1.2 0:35.10 fetch_webserver 4278 root 20 0 178m 17m 5936 R 2 1.1 0:36.02 fetch_webserver
4687 root 20 0 178m 17m 5936 R 2 1.2 0:33.50 fetch_webserver 4983 root 20 0 178m 17m 5936 R 2 1.2 0:30.74 fetch_webserver
5084 root 20 0 177m 17m 5936 R 2 1.2 0:28.52 fetch_webserver 5177 root 20 0 177m 17m 5936 R 2 1.2 0:28.62 fetch_webserver
5490 root 20 0 177m 17m 5936 R 2 1.2 0:28.70 fetch_webserver 5584 root 20 0 177m 17m 5936 R 2 1.2 0:28.88 fetch_webserver
5696 root 20 0 177m 17m 5936 R 2 1.1 0:28.30 fetch_webserver 5782 root 20 0 177m 17m 5936 R 2 1.2 0:27.64 fetch_webserver
Hugo Leisink
15 February 2013, 18:43
Does the high server load only occur when you visit the Monitor website or is it because of the 'fetch_webserver_logs' script?

I find this very weird. I also use the Monitor and a few webservers together are good for 100.000+ requests. It doesn't affect the load on my server for even a bit.
Hugo Leisink
15 February 2013, 19:03
Btw, what kind of script is /var/www/monitor/public/chart/requests.php? The Monitor doesn't have such script.
This topic has been closed.