Diagnose a slow site without guessing
Site feels sluggish, everyone blames the host. Walk the layers top-down:
— Where's the time going? curl -w '@curl-format.txt' -o /dev/null -s https://yoursite with a format file printing connect / starttransfer
— High starttransfer = backend. Tail the slowlog: enable php-fpm slowlog + request_slowlog_timeout = 2s
— Still slow? It's the DB. Turn on MySQL slow_query_log with long_query_time = 1
— Run EXPLAIN on the worst query — 90% of the time it's a missing index
Measure each hop, never blame the box first. Try it tonight.
Root Access Daily
@RootAccessDaily
Diagnose a slow site without guessing
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.