PuppyIP Resource Center
Network & Connection Troubleshooting 10 min Published 2026-11-17

Nezha service_histories SQLite Fills the Disk: Safe Checks Before and After TSDB

When Nezha history storage grows, measure SQLite, journal and Docker logs separately. Enabling TSDB does not prove the old database migrated or was reclaimed.

Nezha SQLite service_histories TSDB Docker logs Linux disk

Service eligibility and regional restrictions

PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.

Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.

Key Takeaways

  • Disk use may come from Nezha SQLite, SQLite journal files and Docker JSON logs; do not focus on one large database without checking the rest.
  • After enabling TSDB, verify writes and reads for the running release. The old SQLite database is not thereby proven migrated or safe to delete.
  • Plan backups and integrity checks after checking database size, write activity and free space; VACUUM on a large database may need substantial extra capacity.
  • Only plan to retain or clean up the old database after confirming current reads and writes, recoverable backups and version-specific documentation.

Separate database growth from other disk usage

As a Nezha dashboard runs longer, historical records can make its SQLite database larger. Journal or WAL files may also consume space during active writes. If the dashboard runs in Docker, container JSON logs can grow as well. When the host reports low disk space or database write failures, first identify the root filesystem and the actual directory sizes. Do not immediately delete the SQLite database, its journal, the whole container directory or every log.

Enabling TSDB changes a history-storage path; it does not prove that older SQLite records were migrated, compacted or removed. Initialization, compatibility reads and old-data retention can vary by Dashboard release, so check the official documentation for the version actually running. A history page displaying records also does not prove that future writes use the intended backend.

Read-only checks for the filesystem, database and Docker JSON logs

Start with read-only checks for the root filesystem, Nezha data directory and Docker container logs. Replace the path placeholders with the actual data locations. If Docker uses a logging driver other than json-file, the log search may return nothing. Container paths and file names can expose deployment details; redact them before sharing.

If sqlite3 is available and the database can tolerate low-load reads, inspect its table list or run an integrity check. An integrity check may read a large database and use disk I/O; avoid running it during peak writes. Do not install a tool just for this check on a production host.

Measure disk usage by source

sh
df -h /
du -sh /PATH/TO/NEZHA-DATA /var/lib/docker/containers 2>/dev/null
find /var/lib/docker/containers -type f -name '*-json.log' -printf '%s %p\n' 2>/dev/null | sort -nr | head -n 20
stat -c '%s %n' /PATH/TO/NEZHA.sqlite* 2>/dev/null
Run read-only measurements on Linux and replace the placeholders with actual data paths. Redact container identifiers and paths before public sharing.

Optional read-only SQLite checks

sh
sqlite3 /PATH/TO/NEZHA.sqlite 'PRAGMA integrity_check;'
sqlite3 /PATH/TO/NEZHA.sqlite 'SELECT name FROM sqlite_master WHERE type="table" ORDER BY name;'
Use only if sqlite3 is already available, the database path is confirmed and read load is acceptable. These queries do not migrate or repair the database.

Verify that TSDB actually receives new history

Before changing storage, confirm the running Nezha Dashboard release, configuration source, TSDB endpoint, authentication and persistent volume. Follow documentation for that exact release and keep the original SQLite file and configuration backup. Do not copy environment variables from an old guide or assume that a container rebuild preserves the same mount; setting names and migration procedures can change between releases.

After enabling TSDB, check Dashboard startup logs, TSDB service health and whether newly produced service history can be read as expected. A setting, running container or new directory is not enough to prove writes work. If new history is missing, queries fail or authentication is rejected, stop old-database cleanup, restore the backed-up configuration and inspect the original SQLite path.

Back up and verify before considering SQLite compaction or cleanup

Before database maintenance, create a consistent backup using an application-supported method, then verify that it is readable, has a plausible size and can be restored from an isolated copy. A running SQLite database may have journal/WAL files; copying only the main file does not guarantee a complete snapshot. If the application provides a controlled backup or SQLite online-backup method, follow documentation for the release in use.

VACUUM rebuilds the database and may require free space close to the database size; it changes the file layout and is not an emergency space-recovery command. Before deleting older history, a journal or the old database, confirm retention requirements, TSDB data completeness, whether the dashboard still reads the old database and whether the original format can be restored. If there is not enough room for a safe backup, expand storage or move the backup first rather than deleting the only copy.

Treat Docker logs as a separate source of usage

If Docker JSON logs account for much of the usage, identify the exact container and writer, then review the log-rotation options supported by Docker's official documentation. Changing the logging driver or rotation settings may require recreating the container to take effect. Schedule a maintenance window and preserve the compose file, container arguments and volume mappings. Do not substitute docker system prune or wildcard deletion under the container directory for a rotation policy.

SQLite journals, application history and Docker stdout/stderr logs have different lifecycles. Changing one does not override retention needs for the others. After a change, separately observe file growth, container state, Dashboard history queries and remaining disk space; one df reading is not enough to close the capacity issue.

Completion criteria and rollback conditions

Close the capacity investigation only after confirming that the Dashboard reads and writes new history, database integrity is acceptable, Docker services and persistent volumes are healthy and free space remains stable. A working TSDB endpoint does not mean the old SQLite database is no longer used; verify its migration scope and retention policy against the exact release documentation and operational needs.

If queries fail or history disappears after a switch, stop cleaning the old database, restore the original configuration and storage mount from backup, and check the SQLite service again. Until TSDB initialization behavior, Dashboard release details and the old database's deletion conditions are known, retain the old data and mark the decision for review.

Sources

Frequently Asked Questions

Can I delete Nezha's SQLite database as soon as TSDB is enabled?

No. First confirm new-history writes and queries, migration scope and backup recovery for the running release, and check whether the old database is still being read.

Can I delete the SQLite journal or WAL next to the database?

No. It may be part of active database transactions. Confirm service state and follow the supported backup and maintenance procedure instead of deleting it to free space.

Can I run VACUUM when the database is large?

Only after confirming enough extra capacity, a complete backup and a maintenance window. VACUUM rebuilds the file and may need substantial temporary space, so do not run it blindly when the disk is full.

Can I delete the whole container directory to remove Docker logs?

No. Identify the logging driver and container, then configure rotation using Docker's supported method and apply it during maintenance. Do not delete container volumes or historical databases.