Re: Slow Apache 2.4 server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Maybe you should first find where the slowness come from (most probably it is php, rather than Apache).

You could try to measure the php execution time from the beginning of the request to the end of it, then you will have some more information where to dig further.

It wont be a good idea to start optimizing blindly some stuff, without being sure where exactly the problem is.


Regards,


On 06/20/2018 07:31 PM, Jørn wrote:
Hello,

I have a problem with slow access from Apache 2.4.27 (new server) compared to an older
Apache 2.2.14 (old server.
The old server is a dual core AMD running Fedora Core 12 with 4Gb physical memory, while
the new server is an 8 core AMD with 16 Gb memory.

It is the same PHP code on both. The old server has PHP version 5.2.12 and the new server
has PHP 7.0.25. The PHP code access the same database.

Below is an extract from the access log file from both servers. Both requests are the same
resulting in rendering a lot of thumbnails. On the old server (with other traffic), the
total time from the first GET to the last one is 4 seconds. While on the new server the
time is 7 seconds.

I have not done touch/tuned any parameters since I do not know which one to touch.

My BIG question is: What can be done to make the new server as fast as the old one?

I have included some output from httpd -V and from the access log showing relevant
requests.


Old server> httpd -V
Server version: Apache/2.2.14 (Unix)
Server built:   Feb 16 2010 22:30:44
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
   threaded:     no
     forked:     yes (variable process count)
Server compiled with....
  -D APACHE_MPM_DIR="server/mpm/prefork"
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT="/usr/local/apache2"
  -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
  -D DEFAULT_PIDLOG="logs/httpd.pid"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_LOCKFILE="logs/accept.lock"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
  -D SERVER_CONFIG_FILE="conf/httpd.conf"
New server> httpd -V
Server version: Apache/2.4.27 (Fedora)
Server built:   Jul 17 2017 13:12:07
Server's Module Magic Number: 20120211:68
Server loaded:  APR 1.6.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
   threaded:     no
     forked:     yes (variable process count)
Server compiled with....
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=256
  -D HTTPD_ROOT="/etc/httpd"
  -D SUEXEC_BIN="/usr/sbin/suexec"
  -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="conf/mime.types"
  -D SERVER_CONFIG_FILE="conf/httpd.conf"


 From old server accessed from internet over a 5Mbit line:

20/Jun/2018:13:38:12 +0200 "GET /album/styrkeprveun/content HTTP/1.1" 200 36405
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155181p9s0/render HTTP/1.1" 200 7039
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155183p5k0/render HTTP/1.1" 200 7516
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/1551897qn0/render HTTP/1.1" 200 8879
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155184ot70/render HTTP/1.1" 200 7933
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155187xrb0/render HTTP/1.1" 200 7946
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155191rr50/render HTTP/1.1" 200 8160
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155190aau0/render HTTP/1.1" 200 8229
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155193bto0/render HTTP/1.1" 200 8176
20/Jun/2018:13:38:13 +0200 "GET /image/thumbnail/155195z940/render HTTP/1.1" 200 7294
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155199zwi0/render HTTP/1.1" 200 8323
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155202rmm0/render HTTP/1.1" 200 8783
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155197q9a0/render HTTP/1.1" 200 7148
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155207h760/render HTTP/1.1" 200 7162
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155209rdv0/render HTTP/1.1" 200 7673
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155212em50/render HTTP/1.1" 200 9299
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/1552148du0/render HTTP/1.1" 200 9065
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155204c9f0/render HTTP/1.1" 200 7462
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155216cno0/render HTTP/1.1" 200 7407
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155218znv0/render HTTP/1.1" 200 7477
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/1552193c50/render HTTP/1.1" 200 7489
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155221ccz0/render HTTP/1.1" 200 7604
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155222t3m0/render HTTP/1.1" 200 8050
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155223fdu0/render HTTP/1.1" 200 7990
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155224tuz0/render HTTP/1.1" 200 8019
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155225ykd0/render HTTP/1.1" 200 8059
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155226tyx0/render HTTP/1.1" 200 8030
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155227w6a0/render HTTP/1.1" 200 8252
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155229fhj0/render HTTP/1.1" 200 8020
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155230aiu0/render HTTP/1.1" 200 8130
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155231du70/render HTTP/1.1" 200 8192
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155228rhw0/render HTTP/1.1" 200 8237
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155232dn90/render HTTP/1.1" 200 8140
20/Jun/2018:13:38:14 +0200 "GET /image/thumbnail/155233x3m0/render HTTP/1.1" 200 7880
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155234ruf0/render HTTP/1.1" 200 7856
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155235rtz0/render HTTP/1.1" 200 7901
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552364mx0/render HTTP/1.1" 200 7826
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552372i40/render HTTP/1.1" 200 8292
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155238bak0/render HTTP/1.1" 200 7869
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552417o20/render HTTP/1.1" 200 7019
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155244pwi0/render HTTP/1.1" 200 7450
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155247jad0/render HTTP/1.1" 200 7015
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155251pmy0/render HTTP/1.1" 200 7430
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155252xjz0/render HTTP/1.1" 200 8292
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155254ibu0/render HTTP/1.1" 200 8548
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155255w3n0/render HTTP/1.1" 200 8447
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155257v590/render HTTP/1.1" 200 7356
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155259s6r0/render HTTP/1.1" 200 7189
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155260vfz0/render HTTP/1.1" 200 7902
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155262fmn0/render HTTP/1.1" 200 7993
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155264fbj0/render HTTP/1.1" 200 7967
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155266xtt0/render HTTP/1.1" 200 6956
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155267aie0/render HTTP/1.1" 200 7339
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552699gx0/render HTTP/1.1" 200 8068
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552719x80/render HTTP/1.1" 200 8268
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/1552743ta0/render HTTP/1.1" 200 6943
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155275ppd0/render HTTP/1.1" 200 7451
20/Jun/2018:13:38:15 +0200 "GET /image/thumbnail/155276xhi0/render HTTP/1.1" 200 7213
20/Jun/2018:13:38:16 +0200 "GET /image/thumbnail/155278ocw0/render HTTP/1.1" 200 6816
20/Jun/2018:13:38:16 +0200 "GET /image/thumbnail/155279nqi0/render HTTP/1.1" 200 7283
20/Jun/2018:13:38:16 +0200 "GET /image/thumbnail/155280a6s0/render HTTP/1.1" 200 7385
20/Jun/2018:13:38:16 +0200 "GET /image/thumbnail/155281t3m0/render HTTP/1.1" 200 7452

Range: 20/Jun/2018:13:38:12 - 20/Jun/2018:13:38:16. Total of 4 seconds.

New server accessed from internal 100Mbit network:
Jun/2018:18:10:34 +0200 "GET /album/styrkeprveun/content HTTP/1.1" 200 51460
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155184ot70/render HTTP/1.1" 200 7933
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155190aau0/render HTTP/1.1" 200 8229
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155183p5k0/render HTTP/1.1" 200 7516
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155187xrb0/render HTTP/1.1" 200 7946
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/1551897qn0/render HTTP/1.1" 200 8879
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155181p9s0/render HTTP/1.1" 200 7039
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155191rr50/render HTTP/1.1" 200 8160
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155193bto0/render HTTP/1.1" 200 8176
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155197q9a0/render HTTP/1.1" 200 7148
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155195z940/render HTTP/1.1" 200 7294
Jun/2018:18:10:35 +0200 "GET /image/thumbnail/155199zwi0/render HTTP/1.1" 200 8323
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155202rmm0/render HTTP/1.1" 200 8783
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155204c9f0/render HTTP/1.1" 200 7462
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155207h760/render HTTP/1.1" 200 7162
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155209rdv0/render HTTP/1.1" 200 7673
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155212em50/render HTTP/1.1" 200 9299
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/1552148du0/render HTTP/1.1" 200 9065
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155218znv0/render HTTP/1.1" 200 7477
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155216cno0/render HTTP/1.1" 200 7407
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/1552193c50/render HTTP/1.1" 200 7489
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155223fdu0/render HTTP/1.1" 200 7990
Jun/2018:18:10:36 +0200 "GET /image/thumbnail/155221ccz0/render HTTP/1.1" 200 7604
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155222t3m0/render HTTP/1.1" 200 8050
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155224tuz0/render HTTP/1.1" 200 8019
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155225ykd0/render HTTP/1.1" 200 8059
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155226tyx0/render HTTP/1.1" 200 8030
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155227w6a0/render HTTP/1.1" 200 8252
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155228rhw0/render HTTP/1.1" 200 8237
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155229fhj0/render HTTP/1.1" 200 8020
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155230aiu0/render HTTP/1.1" 200 8130
Jun/2018:18:10:37 +0200 "GET /image/thumbnail/155231du70/render HTTP/1.1" 200 8192
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155232dn90/render HTTP/1.1" 200 8140
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155233x3m0/render HTTP/1.1" 200 7880
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155234ruf0/render HTTP/1.1" 200 7856
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155235rtz0/render HTTP/1.1" 200 7901
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/1552417o20/render HTTP/1.1" 200 7019
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/1552364mx0/render HTTP/1.1" 200 7826
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/1552372i40/render HTTP/1.1" 200 8292
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155238bak0/render HTTP/1.1" 200 7869
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155244pwi0/render HTTP/1.1" 200 7450
Jun/2018:18:10:38 +0200 "GET /image/thumbnail/155247jad0/render HTTP/1.1" 200 7015
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155251pmy0/render HTTP/1.1" 200 7430
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155252xjz0/render HTTP/1.1" 200 8292
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155254ibu0/render HTTP/1.1" 200 8548
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155255w3n0/render HTTP/1.1" 200 8447
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155259s6r0/render HTTP/1.1" 200 7189
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155260vfz0/render HTTP/1.1" 200 7902
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155257v590/render HTTP/1.1" 200 7356
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155262fmn0/render HTTP/1.1" 200 7993
Jun/2018:18:10:39 +0200 "GET /image/thumbnail/155264fbj0/render HTTP/1.1" 200 7967
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155266xtt0/render HTTP/1.1" 200 6956
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155267aie0/render HTTP/1.1" 200 7339
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/1552699gx0/render HTTP/1.1" 200 8068
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/1552719x80/render HTTP/1.1" 200 8268
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/1552743ta0/render HTTP/1.1" 200 6943
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155276xhi0/render HTTP/1.1" 200 7213
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155275ppd0/render HTTP/1.1" 200 7451
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155278ocw0/render HTTP/1.1" 200 6816
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155279nqi0/render HTTP/1.1" 200 7283
Jun/2018:18:10:40 +0200 "GET /image/thumbnail/155280a6s0/render HTTP/1.1" 200 7385
Jun/2018:18:10:41 +0200 "GET /image/thumbnail/155281t3m0/render HTTP/1.1" 200 7452

Range: Jun/2018:18:10:34 - Jun/2018:18:10:41. Total of 7 seconds.


--
-- Gryzli

https://gryzli.info


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux