background

Documentation

back to Framework

Reduce database size

Snapt uses two SQLite databases and depending on your logging preferences, error rate, number of servers and more they can get quite large.

On systems with less CPU, memory and slower disks this can cause performance problems within the UI. Pages taking a few seconds to load, errors about "Slow Database Queries", etc.

Check the size of the tables

The first thing to see is under Reports -> Dashboard and then the Database Status tab. This will show you the rows in each table, and you are looking for the big ones.

Typically redklog and snaptHA_logsimple are the largest. You can empty these tables to clear the database - all the tables on this page can be deleted but you will lose historical reports or metrics for those tables/programs.

If snaptHA_logsimple is very large, you should go (after deleting) to the Balancer -> Logging Options page and increse your logging interval. 10 minutes instead of 5 minutes will halve the logs generated.

Vacuum a database

With SQLite after a large delete is done you may need to run a vacuum command to reduce it's disk space and optimize the database. This can be done on the log.db file in /srv/www/htdocs/db/ or on the bundle in /usr/local/snapt/program/db/.

sqlite3 log.db

VACUUM;
.q

The first command will enter the SQLite database. Then the second will vacuum it.

If you have a corrupt database or this fails please follow the repair SQLite database guide.

Documentation

Go back to the main documentation portal?