Note: using apache
v2.4.6, PHP 7.2.24
I have deployed a PHP application on a CentOS 7 server using httpd. We have two environments (production and testing) and while testing is fast, production is slow.
After checking, it seems the main cause of slowdown on production is the fact that it takes up to 4 seconds to even start running the PHP scripts.
I placed a die;
statement at the very beginning of the PHP scripts, and when accessing the site with Firefox, here are the response times:
- 150ms for testing
- 4s with production
What I find bizarre is that the production server is a clone of the testing server, so the PHP/Apache config is the same. The database is different, but I don't think that has anything to do with it since the long response times occur before any calls are made to it.
I looked online and saw it could be due to a "ServerName" directive, but I checked and the config files don't use it.
Are there log files I could look at to see what is taking Apache so long? I've also noticed that apachectl
also takes way longer to execute on prod than on test. Even service httpd configtest
which is instantaneous on test server takes a while.