Sobes.tech
Senior

The database is down since morning, nothing has been changed — how to diagnose?

sobes.tech AI

Answer from AI

If the database is "frozen" without visible changes, diagnostics should be systematic and step-by-step:

  1. Check server status and resources:

    • Use top, htop, vmstat, iostat to assess CPU, memory, and disk load.
    • Check free disk space (df -h).
  2. Database logs:

    • Review error and event logs (e.g., postgresql.log, mysqld.log).
    • Pay attention to lock errors, buffer overflows, network issues.
  3. Locks and waits:

    • Run queries to identify locks (e.g., in PostgreSQL SELECT * FROM pg_locks WHERE NOT granted;).
    • Check for long transactions that may be blocking others.
  4. Network issues:

    • Ensure the network between the application and the database is functioning correctly.
  5. Query monitoring:

    • Enable slow query log if not already enabled.
    • Use query profiling tools.
  6. Configuration check:

    • Ensure database parameters have not changed.
  7. External factors:

    • Check if heavy backups or maintenance operations are running.

This systematic approach will help identify the cause of the downtime and take appropriate measures.

The database is down since morning, nothing has been… - sobes.tech