Figuring out what’s causing a server to slow down

monitoringnetwork-monitoringperformanceperformance-monitoringperformance-tuning

I have a potential client that has a php site that performs fine most of the time. However, every week or so, it will experience lag (slow page loading). I am sure there are a myriad of things that can be causing this (network issues, bad installation, a specific php file, increased traffic load). However, I need a way to deduce what is causing this. Is there any server monitoring software that is made especially to handle these situations?

PS: The server is linux

Best Answer

I would find out the following:

  • Does this "slow down" effect all users?
  • Is this slow down for the entire site, or just a specific set of functions within the site?
  • Does it happen at the same time every day and the same day each week?

If the slowdown is always on Friday at quitting time and the application is used for users to enter their time card data for the week, it might simply be the server needs more CPU/Memory and or Bandwidth to take the load of all the last-minute users. Suffice it to say, those type of patterns will be hard to track down without knowing the ins and outs of the application and its users and uses.

In order to recommend tools, we'd need to know what OS your app is running on? Windows/IIS, Linux/Apache? However, in my anecdotal experience, site slowdown is caused by one of a few things:

  • Poor database programming
    • SELECT * FROM TableXYZ
    • Queries to un-indexed columns
  • Server Issues
    • Not enough memory
    • Not enough bandwidth
      • Server --> User
      • Server --> Database

The most common things to check (for performance related problems) are

  • Database Server
    • CPU Load
    • Available Memory
    • Disk Queue Length (is your disk IO maxed out?
  • Web Server
    • CPU Load
    • Memory Usage
    • Bandwidth to end users
    • Bandwidth to database server