Witam,
Posiadam od roku serwer dedykowany na którym mam postawiony Apache + MySQL + Direct Admin. Na serwerze obecnie mam 142 blogi Wordpress, do ok 2 tygodni temu load wynosił 3-4%, obecnie jest to od 35% do momentami nawet i 255%. Co prawda na serwerze postawionych jest 140 blogów wordpress, ale jest na nich bardzo mały ruch, czasami kilkaset osób w ciągu dnia i tyle. Według logów z 32GB RAM używane jest nie całe 10GB.
Parametry serwera:
- Procesor: Intel Xeon E3-1270v6 - 4/8t - 3.8GHz /4.2GHz
- RAM: 32GB DDR4 ECC 2133 MHz
Wynik polecenia httpd -V
Server version: Apache/2.4.37 (Unix) Server built: Nov 1 2018 14:48:36 Server's Module Magic Number: 20120211:83 Server loaded: APR 1.6.5, APR-UTIL 1.6.1 Compiled using: APR 1.6.5, APR-UTIL 1.6.1 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 HAVE_SYSTEMD -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="/var/logs/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"
Myślę, że screen wszystko wyjaśni:
Obecnie wygląda to tak:
Serwer został zakupiony rok temu i od razu w pakiecie był zainstalowany direct admin, więc nic nie było sensownie optymalizowane, ale patrząc na obecną sytuację bardzo by się przydało, bo są momenty, że strony chodzą bardzo szybki i jest dużo takich momentów, gdzie strona w ogóle się nie wczytuje, chociaż na serwerze nie ma obciążenia. Jakiś pomysł co zrobić, żeby LA spadł dużo niżej, i żeby serwer szybko chodził? Mój /etc/httpd/conf/extra/httpd-mpm.conf
# # Server-Pool Management (MPM specific) # # # PidFile: The file in which the server should record its process # identification number when it starts. # # Note that this is the default PidFile for most MPMs. # <IfModule !mpm_netware_module> PidFile "/var/run/httpd.pid" </IfModule> # # Only one of the below sections will be relevant on your # installed httpd. Use "apachectl -l" to find out the # active mpm. # # # Only one of the below sections will be relevant on your # installed httpd. Use "apachectl -l" to find out the # active mpm. # # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxRequestWorkers: maximum number of server processes allowed to start # MaxConnectionsPerChild: maximum number of connections a server process serves # before terminating <IfModule mpm_prefork_module> StartServers 4 MinSpareServers 3 MaxSpareServers 10 ServerLimit 256 MaxRequestWorkers 256 MaxConnectionsPerChild 20000 </IfModule> # worker MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestWorkers: maximum number of worker threads # MaxConnectionsPerChild: maximum number of connections a server process serves # before terminating <IfModule mpm_worker_module> StartServers 3 MinSpareThreads 2 MaxSpareThreads 3 ThreadsPerChild 50 MaxRequestWorkers 100 MaxConnectionsPerChild 20000 </IfModule> # event MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestWorkers: maximum number of worker threads # MaxConnectionsPerChild: maximum number of connections a server process serves # before terminating <IfModule mpm_event_module> StartServers 3 MinSpareThreads 32 MaxSpareThreads 638 ThreadsPerChild 64 ServerLimit 32 MaxRequestWorkers 1024 MaxConnectionsPerChild 15000 </IfModule> # NetWare MPM # ThreadStackSize: Stack size allocated for each worker thread # StartThreads: Number of worker threads launched at server startup # MinSpareThreads: Minimum number of idle threads, to handle request spikes # MaxSpareThreads: Maximum number of idle threads # MaxThreads: Maximum number of worker threads alive at the same time # MaxConnectionsPerChild: Maximum number of connections a thread serves. It # is recommended that the default value of 0 be set # for this directive on NetWare. This will allow the # thread to continue to service requests indefinitely. <IfModule mpm_netware_module> ThreadStackSize 65536 StartThreads 250 MinSpareThreads 25 MaxSpareThreads 50 MaxThreads 1000 MaxConnectionsPerChild 0 </IfModule> # OS/2 MPM # StartServers: Number of server processes to maintain # MinSpareThreads: Minimum number of idle threads per process, # to handle request spikes # MaxSpareThreads: Maximum number of idle threads per process # MaxConnectionsPerChild: Maximum number of connections per server process <IfModule mpm_mpmt_os2_module> StartServers 2 MinSpareThreads 5 MaxSpareThreads 10 MaxConnectionsPerChild 0 </IfModule> # WinNT MPM # ThreadsPerChild: constant number of worker threads in the server process # MaxConnectionsPerChild: maximum number of connections a server process serves <IfModule mpm_winnt_module> ThreadsPerChild 150 MaxConnectionsPerChild 0 </IfModule> # The maximum number of free Kbytes that every allocator is allowed # to hold without calling free(). In threaded MPMs, every thread has its own # allocator. When not set, or when set to zero, the threshold will be set to # unlimited. <IfModule !mpm_netware_module> MaxMemFree 2048 </IfModule> <IfModule mpm_netware_module> MaxMemFree 100 </IfModule>