Site Is Up But Painfully Slow — Server Diagnosis Guide
Your site is online but takes forever to load. Here's how to diagnose slow server performance step-by-step and find exactly what's dragging it down.
Your site loads — eventually. 5, 10, sometimes 20 seconds. Users are leaving. Here's how to find *what specifically* is slow, not just guess.
Step 1: Measure where time is being spent
Slow sites have a few different flavors, and the fix depends on which one:
- Slow DNS → DNS lookup takes seconds
- Slow TTFB (time to first byte) → your server is slow to start responding
- Slow content download → bandwidth or file size problem
- Slow rendering → browser is struggling with JavaScript/CSS
Open Chrome DevTools → Network tab → reload. Look at the waterfall for the HTML request. Which phase is slow?
If TTFB is slow (over 500ms)
Your server is the bottleneck. Diagnose in this order:
1. Database queries
This is the #1 cause. Turn on slow query logging:
``sql
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;
``
Then check what's slow:
``
tail -f /var/log/mysql/slow.log
``
Most slow queries are missing an index. Add the index, problem solved.
2. External API calls
If your app calls an external service during a page render — and that service is slow — your whole page is slow. Fixes:
- Cache responses
- Call asynchronously (after the page loads, not during)
- Set a short timeout with a fallback
3. Too many database queries
If each page makes 500 queries, even fast ones add up. Look for N+1 query patterns. Most ORMs have tools to detect these.
4. No caching
If every request recomputes the whole page from scratch, you're wasting CPU. Add a cache layer:
- Redis or Memcached for data
- Full-page cache for static-ish pages
- HTTP caching headers for assets
5. Server is underpowered
- If CPU is pegged at 100% even on simple requests, the server isn't big enough for your load. Options:
- Upgrade to a larger VPS
- Horizontal scaling (multiple servers behind a load balancer)
- Offload to a CDN for static files
If content download is slow
You're serving too much data.
Check page weight
A homepage should be under 2MB. Ideally under 1MB. Open DevTools → Network → check "Resources" at the bottom.
Common culprits
- Huge images — compress them. WebP format. Resize to actual display size.
- Video backgrounds — kill these or make them much smaller
- Custom fonts — each variant adds ~200KB. Use system fonts where possible.
- JavaScript bundles — code-split, only load what's needed
- No GZIP compression — should be enabled on your server (check response headers for
content-encoding: gzip)
Put a CDN in front
A CDN serves static files from servers close to your visitors. Cloudflare's free tier is excellent for this.
If server responds fast but the browser is slow
Your server isn't the problem — the browser is struggling.
Common causes
- Too much JavaScript running on page load
- Render-blocking CSS in
<head> - Heavy third-party scripts (analytics, chat widgets, ad networks)
- Layout shifts triggering re-renders
Fixes
- Defer non-critical scripts (
<script defer>) - Inline critical CSS, lazy-load the rest
- Remove third-party scripts you don't actually use
- Use Chrome's Performance tab to profile the slow rendering
Quick sanity checks
- PageSpeed Insights — Google's tool gives you a score and specific fixes
- GTmetrix — detailed waterfall across different locations
- Pingdom — simple speed tests from different regions
Need help?
I run speed audits and optimize servers all the time — most sites can go from 5-8 second loads to under 2 seconds with a few focused changes. Send me a message and I'll take a look at your site.
Need Help With Your Website?
I fix these problems every day. Send me a message and I'll take a look.
Get Help Now