Profiling Performance of PHP Web Applications
Performance is a function of so many factors: hardware, load, code, caching, load-balancing, monitoring, redundancy and so-forth. It's critical to profile your entire application stack, to determine where the issues are. Guessing, or theories about slowness will waste time and money; use profiling tools, examine the data and use science!
Application Performance Overview
At it's core applications or website performance tuning is a simple process. Measure the system, make an adjustment, measure again. Simply repeat that process a few hundred times, for each layer of your system and you're done!
- Database Performance
- We've got a good starter references on tuning PostgreSQL and MySQL. Cloud hosted systems (eg RDS) don't give much control over these settings, but you can still tune queries!
- Web-Server Performance
- Which ever is in use, measure and tune your Apache, Lighttpd or Nginx systems.
- Server Code Performance
- Profiling your application with tools like xdebug+Webgrind, XHProf and PHProf can help show the slowness, and tune your code.
- Network Performance
- Use some IDS/IPS to block noisy or malicious traffic to the App stack
- We also have some pointers on improving web-application performance with Optimised CSS, Optimised JS and images.
- Client Code Performance
- Use tools to profile the client side JS