jeffery_the_wind
jeffery_the_wind

Reputation: 18228

How to troubleshoot performance difference between 2 web servers?

I have a production virtual web server that is being migrated to a new virtual web server on the same local network. The problem is that there is a performance problem on the new server.

For example, there is one page that loads in about 1 second on the original server, but takes over 25 seconds to load on the new one. I have already ruled out the database connection as the problem.

Both servers are Ubuntu Apache servers running PHP. There are slight differences in the versions of the servers, I will list as best I can here.

My main question is: is there a general way to profile the web requests on each server?

Similar to the way I can profile a python script or function and get a break-down of which parts of the program take the most time, I would like to profile the web requests on one server compared to the other.

Of course a web requests to the server are fundamentally different than programs run on a local computer, but I need to find where the bottleneck is. Any help is greatly appreciated.

Old Server Config Ubuntu 14.04 - PHP version 5.5.9

New Server Config Ubuntu 16.04 - PHP version 5.6.31 (also tested with version 7, same result)

Upvotes: 0

Views: 45

Answers (1)

user6465431354
user6465431354

Reputation: 153

I would suggest to log PHP script execution time.
If it comes from somewhere in the PHP execution, you will notice it easily.
Do a log at the start and one at the end. Then you can stress test both and see different execution time.
I seriously doubt the problem comes from PHP but if you do that you could also see differences with PHP7 which should be 30% faster.

Upvotes: 1

Related Questions