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:
-
Check server status and resources:
- Use
top,htop,vmstat,iostatto assess CPU, memory, and disk load. - Check free disk space (
df -h).
- Use
-
Database logs:
- Review error and event logs (e.g.,
postgresql.log,mysqld.log). - Pay attention to lock errors, buffer overflows, network issues.
- Review error and event logs (e.g.,
-
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.
- Run queries to identify locks (e.g., in PostgreSQL
-
Network issues:
- Ensure the network between the application and the database is functioning correctly.
-
Query monitoring:
- Enable slow query log if not already enabled.
- Use query profiling tools.
-
Configuration check:
- Ensure database parameters have not changed.
-
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.