$30 off During Our Annual Pro Sale. View Details »

How to troubleshoot WordPress performance

How to troubleshoot WordPress performance

These are the slides from a talk given at WordCamp Halifax 2017.

Have you ever had a client come up to you and ask why a WordPress page was slow to load? We’ve all had that happen at some point or another. Especially nowadays with the increased importance of page load times! (Everything has to be fast fast fast!)

But what do you do when someone asks you to fix such an issue? It can feel like finding a needle in a haystack. The issue could be anywhere. (It really can!)

So how can you troubleshoot what’s going on? There are a lot of tools at your disposal to help you figure things out. But that doesn’t mean that you’re any closer to knowing what’s going on.

This is what this talk will help you with. We’ll look at the tools that you can use to solve this tricky issue. But we won’t stop there either We’ll also go over how to interpret what these tools are telling you. Because that’s how you’ll get to the root of the issue so that you can fix it.

You can read the companion article at: https://carlalexander.ca/troubleshoot-wordpress-performance

Carl Alexander

May 27, 2017
Tweet

More Decks by Carl Alexander

Other Decks in Programming

Transcript

  1. How to troubleshoot
    WordPress performance

    View Slide

  2. Carl Alexander

    View Slide

  3. @twigpress

    View Slide

  4. carlalexander.ca

    View Slide

  5. View Slide

  6. Common situation

    View Slide

  7. Client:
    WordPress is slow.

    View Slide

  8. Client:
    Can you help?

    View Slide

  9. You:

    View Slide

  10. Load times are important

    View Slide

  11. But hard to debug

    View Slide

  12. Needle in a haystack

    View Slide

  13. Issue can be anywhere
    (It really can!)

    View Slide

  14. Lots of tools available

    View Slide

  15. What’s a WordPress
    performance issue?

    View Slide

  16. Slowness defines
    performance issues

    View Slide

  17. Example:
    Loading a page is slow

    View Slide

  18. Example:
    Site search is slow

    View Slide

  19. Example:
    Publishing is slow

    View Slide

  20. Example:
    “Everything is slow”

    View Slide

  21. WordPress takes too long
    to do something

    View Slide

  22. Frustrates the client

    View Slide

  23. Has a financial impact

    View Slide

  24. Where can you
    find them?

    View Slide

  25. What happens when
    you request a web page?

    View Slide

  26. View Slide

  27. View Slide

  28. Most obvious location

    View Slide

  29. Can be your code

    View Slide

  30. Can be plugin code

    View Slide

  31. Can be theme code

    View Slide

  32. Check PHP code

    View Slide

  33. Check JavaScript code

    View Slide

  34. View Slide

  35. Other common location

    View Slide

  36. Dozens of queries
    on each page load

    View Slide

  37. Only takes one slow query

    View Slide

  38. View Slide

  39. Hard to diagnose

    View Slide

  40. Hardware and Software

    View Slide

  41. Varies from host to host

    View Slide

  42. Why picking
    a good host is important

    View Slide

  43. View Slide

  44. Hard to diagnose as well

    View Slide

  45. Browsers are complex

    View Slide

  46. Lots going on between
    requesting and rendering

    View Slide

  47. Can appear anywhere
    between both points

    View Slide

  48. Questions?

    View Slide

  49. Browser tools

    View Slide

  50. Web developer tools

    View Slide

  51. Most important tool
    at your disposal

    View Slide

  52. Available on all browsers

    View Slide

  53. Mandatory tool
    for web development

    View Slide

  54. Console panel

    View Slide

  55. First panel to look at

    View Slide

  56. View Slide

  57. Shows error messages
    and warnings

    View Slide

  58. Useful for rendering
    performance issues

    View Slide

  59. But mostly for JavaScript

    View Slide

  60. Network Panel

    View Slide

  61. View Slide

  62. Look at waterfall first

    View Slide

  63. Scan for long bars

    View Slide

  64. View Slide

  65. Slow first request often
    means issue with server

    View Slide

  66. View Slide

  67. Time To First Byte (TTFB)

    View Slide

  68. Time between request and
    start of response

    View Slide

  69. One of the best metrics for
    application performance

    View Slide

  70. Not a silver bullet

    View Slide

  71. Don’t forget summary!

    View Slide

  72. View Slide

  73. View Slide

  74. View Slide

  75. View Slide

  76. View Slide

  77. Web page
    analysis services

    View Slide

  78. View Slide

  79. View Slide

  80. Questions?

    View Slide

  81. Server tools

    View Slide

  82. If nothing found in browser

    View Slide

  83. Problem is figuring out
    where on the server

    View Slide

  84. Two sources of
    performance issues
    (Hardware and Software)

    View Slide

  85. Start with WordPress

    View Slide

  86. Query Monitor

    View Slide

  87. Best debugging
    plugin for WordPress

    View Slide

  88. Collects all sorts of
    information on WordPress
    (More than just SQL queries!)

    View Slide

  89. Visible from the admin bar

    View Slide

  90. Visible from the admin bar

    View Slide

  91. Visible from the admin bar

    View Slide

  92. Visible from the admin bar

    View Slide

  93. Additional HTTP requests
    can also slow things down

    View Slide

  94. View Slide

  95. View Slide

  96. View Slide

  97. Database server processes

    View Slide

  98. View Slide

  99. View Slide

  100. SQL query:
    SHOW FULL PROCESSLIST;

    View Slide

  101. Additional tools
    (But need access to your server)

    View Slide

  102. Slow logs

    View Slide

  103. MySQL tuner

    View Slide

  104. Application
    performance monitoring

    View Slide

  105. Questions?

    View Slide

  106. Recapping

    View Slide

  107. How do you use
    these tools together?

    View Slide

  108. View Slide

  109. View Slide

  110. View Slide

  111. View Slide

  112. Still stuck? Ask for help!

    View Slide

  113. Questions?

    View Slide

  114. Thank you!

    View Slide