Hello,
I run a website with a large number of posts (about 500,000) and whenever Google bots come to index the posts, the server load will exceed 6% and apache will crash. Surely, apache will self- start and a few minutes later will crash again.
I run a VPS with 5 processors and 5GB of RAM along with PHP-FPM 7.1 and MySQL. Memcached server and client are also installed. I am not aware if there any other PHP cache module is installed.
Below is the output of the top command:
Below is the apache status log:
I would like to receive some feedback from the community in order to optimise apache, mysql and php-fpm.
Many thanks.
I run a website with a large number of posts (about 500,000) and whenever Google bots come to index the posts, the server load will exceed 6% and apache will crash. Surely, apache will self- start and a few minutes later will crash again.
I run a VPS with 5 processors and 5GB of RAM along with PHP-FPM 7.1 and MySQL. Memcached server and client are also installed. I am not aware if there any other PHP cache module is installed.
Below is the output of the top command:
Code:
top - 12:07:16 up 2 days, 15:12, 1 user, load average: 6.63, 6.39, 5.91
Tasks: 199 total, 2 running, 196 sleeping, 0 stopped, 1 zombie
%Cpu(s): 48.5 us, 47.2 sy, 0.0 ni, 0.6 id, 0.0 wa, 0.0 hi, 0.3 si, 3.3 st
KiB Mem : 4931796 total, 120748 free, 2632020 used, 2179028 buff/cache
KiB Swap: 4980732 total, 4715004 free, 265728 used. 1705944 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1181 mysql 20 0 2544528 242456 4980 S 480.1 4.9 4487:20 mysqld
100796 adb98765 20 0 546476 44700 16540 S 10.9 0.9 0:02.74 php-fpm
1356 memcach+ 20 0 566320 65232 944 S 4.0 1.3 48:01.76 memcached
53625 root 20 0 183584 27560 2156 S 0.3 0.6 2:17.95 lfd - sleeping
1 root 20 0 193908 5216 3000 S 0.0 0.1 4:27.34 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.32 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.55 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root rt 0 0 0 0 S 0.0 0.0 0:00.47 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 R 0.0 0.0 2:33.64 rcu_sched
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
11 root rt 0 0 0 0 S 0.0 0.0 0:01.85 watchdog/0
12 root rt 0 0 0 0 S 0.0 0.0 0:01.72 watchdog/1
13 root rt 0 0 0 0 S 0.0 0.0 0:00.54 migration/1
14 root 20 0 0 0 0 S 0.0 0.0 0:00.59 ksoftirqd/1
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
17 root rt 0 0 0 0 S 0.0 0.0 0:01.67 watchdog/2
18 root rt 0 0 0 0 S 0.0 0.0 0:00.42 migration/2
19 root 20 0 0 0 0 S 0.0 0.0 0:00.54 ksoftirqd/2
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H
22 root rt 0 0 0 0 S 0.0 0.0 0:01.70 watchdog/3
23 root rt 0 0 0 0 S 0.0 0.0 0:00.54 migration/3
24 root 20 0 0 0 0 S 0.0 0.0 0:00.54 ksoftirqd/3
26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0H
27 root rt 0 0 0 0 S 0.0 0.0 0:01.72 watchdog/4
28 root rt 0 0 0 0 S 0.0 0.0 0:00.44 migration/4
29 root 20 0 0 0 0 S 0.0 0.0 0:01.03 ksoftirqd/4
Code:
Server Version: Apache/2.4.33 (cPanel) OpenSSL/1.0.2o mod_bwlimited/1.4
Server MPM: event
Server Built: Apr 23 2018 21:10:29
Current Time: Wednesday, 23-May-2018 12:25:25 AEST
Restart Time: Wednesday, 23-May-2018 05:58:31 AEST
Parent Server Config. Generation: 9
Parent Server MPM Generation: 8
Server uptime: 6 hours 26 minutes 53 seconds
Server load: 5.92 6.16 5.99
Total accesses: 8622 - Total Traffic: 164.9 MB
CPU Usage: u171.78 s16.27 cu0 cs0 - .81% CPU load
.371 requests/sec - 7.3 kB/second - 19.6 kB/request
63 requests currently being processed, 87 idle workers
Slot PID Stopping Connections Threads Async connections
total accepting busy idle writing keep-alive closing
0 90890 yes (old gen) 22 no 0 0 0 0 0
1 90891 yes (old gen) 23 no 0 0 0 0 0
2 90892 yes (old gen) 19 no 0 0 0 0 0
3 90893 yes (old gen) 23 no 0 0 0 0 0
4 90894 yes (old gen) 27 no 0 0 0 0 0
5 91260 yes (old gen) 25 no 0 0 0 0 0
6 92447 yes (old gen) 25 no 0 0 0 0 0
7 92448 yes (old gen) 25 no 0 0 0 0 0
8 92449 yes (old gen) 25 no 0 0 0 0 0
9 92450 yes (old gen) 24 no 0 0 0 0 0
10 92451 yes (old gen) 24 no 0 0 0 0 0
11 92605 yes (old gen) 24 no 0 0 0 0 0
12 96656 yes (old gen) 26 no 0 0 0 0 0
13 96657 yes (old gen) 25 no 0 0 0 0 0
14 96658 yes (old gen) 24 no 0 0 0 0 0
15 96659 yes (old gen) 24 no 0 0 0 0 0
16 96660 yes (old gen) 25 no 0 0 0 0 0
17 96820 yes (old gen) 25 no 0 0 0 0 0
18 84498 yes (old gen) 24 no 0 0 0 0 0
19 101429 no 11 yes 10 15 0 1 0
20 84500 yes (old gen) 24 no 0 0 0 0 0
21 84501 yes (old gen) 24 no 0 0 0 0 0
22 84502 yes (old gen) 25 no 0 0 0 0 0
23 84653 yes (old gen) 25 no 0 0 0 0 0
24 101430 no 15 yes 14 11 0 0 0
25 101431 no 15 yes 14 11 0 0 0
26 101432 no 10 yes 10 15 0 0 0
27 101433 no 12 yes 11 14 0 0 1
28 101584 no 5 yes 4 21 0 0 0
Sum 29 23 625 63 87 0 1 1
GGGGGGGG.GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGG.GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GW___W_W____WW_W_W_WW_W___GGGGGGGGWW___WWW_WWWW__WWW_W___W_W_WW_
_W__WW_WW__WWWW_W__W_WW_____WW_WW_WW__W_W____W__W_WW_WW_W_____W_
W_WW__WW_____________W____W____
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process
Many thanks.