3

I have been searching for a solution for my problem a long time and tried many proposed solutions but to no end yet.

The Problem I have several websites (4) on my webserver using virtual hosts. Most of the time it works fine but sometimes (around once every 5 minutes) the response takes very long (> 30 seconds). When I reload the page, most of the times it responds normally (< 2 secs). It happens on all 4 websites and seems to be happening randomly. It seems to happen on all browser types.

What I tried already I have full control over all parts of the system so I tried many thing to find out where the problem might be. In my PHP application/profiling logs the time between the start of a request and the response is never longer than 1 second. This tells me the problem is not PHP/Mysql related.

The problem occurred when I had a older version of Apache installed and also when I used PHP 5.x. Since I have installed PHP 7 requests responded quicker but only for those requests that had not these very long response times.

I have installed openssl but the problem did occur before I was using SSL requests also.

CPU on the virtual machine never is higher than 20% and used memory never is above 35%. Ethernet throughput seems normal (<500kbps send, <300 kbps receive)

The Apache access and error logs show no abnormal response times

The configuration Microsoft server 2012 R2 standard (Virtual machine) 2 CPU (Westmere E56xx Nehalem-C) 4 GB RAM

Server version: Apache/2.4.23 (win64) (httpd-2.4.23-win64-VC14) PHP 7.0.13 (ZTS) (php-7.0.13-Win32-VC14-x64.zip) MySQL 5.7.12.0 (mysql-installer-web-community-5.7.12.0.msi)

Apache config

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule ssl_module modules/mod_ssl.so

LoadModule php7_module "c:/php70-13/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php70-13"

LogFormat "%h %l %u %t \"%r\" %>s %b %>D %p" common

<VirtualHost *:80>
    ServerAdmin webmaster@aredcard.com
    DocumentRoot "****/sources/public"
    ServerName *****
    ErrorLog "logs/*****-error.log"
    CustomLog "logs/*****-access.log" common
#   ErrorLog "|bin/rotatelogs.exe -l logs/%Y%m%d-*****-error.log 86400"
#   CustomLog "|bin/rotatelogs.exe -l logs/%Y%m%d-*****-access.log 86400" common
    LogLevel notice
    HostnameLookups Off 
    <Directory "******/sources/public">
    Options FollowSymLinks
        AllowOverride All
        <RequireAll>
            Require all granted
            Include conf/Blacklist.conf
        </RequireAll>
    </Directory>
</VirtualHost>

<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers          5
    MaxSpareServers         10
    MaxRequestWorkers      100
    MaxConnectionsPerChild   0
</IfModule>

<IfModule mpm_winnt_module>
    ThreadsPerChild         100
    MaxConnectionsPerChild   0
</IfModule>
TylerH
  • 20,799
  • 66
  • 75
  • 101
Wouter T
  • 71
  • 1
  • 3

0 Answers0