Performance analysis for php devs

Performance analysis for php devs

When writing web applications performance is something that is often in the back of our minds and often times we rely on folklore tales of things that are said to improve performance, but rarely ever do we challenge or confirm them. In this talk I want to showcase some tools that help us change this bad habit of generalizing performance advice and instead focus on how we can improve our application where it hurts.

This talk introduces both established and new tools for profiling PHP applications and running performance tests on our infrastructure. Along the way we will discuss how to continuously keep an eye on key performance metrics by making them part of our development process and what general advice might be useful in our day to day work as developers and if there are some tips we can safely ignore.

6a1345d8e6dd15b2c78eff0c331963b1?s=128

Denis Brumann

January 29, 2019
Tweet

Transcript

  1. 8.
  2. 9.
  3. 10.

    XHPROF originally built for PHP 5 can be used in

    production https://tideways.com/profiler/xhprof-for-php7
  4. 11.
  5. 12.
  6. 14.
  7. 16.
  8. 18.
  9. 19.
  10. 21.
  11. 22.
  12. 24.
  13. 25.
  14. 26.
  15. 27.
  16. 28.
  17. 29.
  18. 30.
  19. 31.
  20. 33.
  21. 34.

    It can be used to simulate a heavy load on

    a server, group of servers, network or object to test its strength or to analyze overall performance under different load types. https://jmeter.apache.org/
  22. 35.
  23. 36.
  24. 37.
  25. 38.
  26. 39.
  27. 40.
  28. 41.
  29. 42.
  30. 43.
  31. 44.
  32. 45.
  33. 46.
  34. 47.
  35. 48.

    WEB SERVER access & error logs DB size, throughput, slow

    queries CACHE size, hits vs. misses, connections SYSTEM cpu & mem usage, disk i/o
  36. 49.
  37. 50.
  38. 51.
  39. 52.
  40. 53.
  41. 54.
  42. 55.
  43. 56.

    WHAT TO LOOK FOR? reading from & writing to disk

    network calls & latency database queries CPU & memory usage
  44. 60.

    MICRO-OPTIMIZATIONS RARELY ARE THE ISSUE focus on data often there

    are huge gains around: API-Requests, DB-Queries,
  45. 62.
  46. 64.
  47. 65.
  48. 68.
  49. 69.

    WHAT TO DO? Measure Improve Measure again Compare Incremental changes

    Don't guess/assume Don't trust benchmarks Re-evaluate old data