Sobes.tech
Middle

How do you diagnose issues with slow website performance?

sobes.tech AI

Answer from AI

  • Frontend performance check:
    • Analyzing page load times using tools like Lighthouse, PageSpeed Insights, or built-in browser developer tools (Network tab).
    • Identifying large static resources (images, scripts, styles) and assessing the need for optimization (compression, caching, lazy loading).
    • Finding blocking render JavaScript or CSS.
  • Network issues analysis:
    • Checking user connection quality (low bandwidth, high latency).
    • Diagnosing DNS resolution (long FQDN lookup).
    • Traffic route analysis (traceroute, ping).
    • Checking for bottlenecks on network devices (routers, switches).
  • Server problem diagnostics:
    • Monitoring CPU, memory, disk subsystem, and network load on the server (using Grafana, Prometheus, Zabbix).
    • Analyzing web server logs (Nginx, Apache) for errors, slow requests, and abnormal activity.
    • Checking application logs for exceptions, slow database or external service requests.
    • Database performance analysis: slow queries, missing indexes, table locks.
    • External service load assessment that the application depends on.
  • Configuration check:
    • Analyzing web server configuration (caching, compression, number of worker processes).
    • Checking database configuration.
    • Evaluating the correctness of cache layers setup (Redis, Memcached).
  • Using Application Performance Monitoring (APM) tools:
    • Using tools like New Relic, Datadog, Dynatrace for detailed request tracing and bottleneck identification at the application code level.
  • Testing:
    • Conducting load testing to identify system limitations under high load.
    • Comparative performance analysis of different application versions or configurations.
# Example of network path check
traceroute ya.ru
-- Example of slow query search in PostgreSQL
SELECT query, elapsed_time, start_time
FROM pg_stat_statements
ORDER BY elapsed_time DESC
LIMIT 10;
# Example of Nginx configuration snippet with caching settings
server {
    # ... other settings ...

    location ~* .(jpg|jpeg|gif|png|svg|webp|ico|css|js)$ {
        expires 30d; # Cache static files for 30 days
        add_header Cache-Control "public, no-transform";
        access_log off;
    }

    # ...
}
Problem Source Diagnostic Tools
Frontend Lighthouse, PageSpeed Insights, DevTools (Network tab)
Network ping, traceroute, mtr
Server top, htop, iostat, vmstat, Grafana, Prometheus, Zabbix
Logs grep, awk, ELK stack, Splunk
Database pg_stat_statements, SHOW PROCESSLIST, DB profilers
APM New Relic, Datadog, Dynatrace
Load JMeter, Gatling, K6