Administration » Maintenance

Maintenance

Keeping your Etomite site healthy

Now you've got your site up and running, you want to keep it in that state! Nearly everything in etomite is sored in the database, so this mainly boils down to keeping the database in a healthy state. 

Managing the database

Fortunately, the database management system (DBMS, MySQL) does most of the work for you behind the scenes, and there isn't much you need to do. The only thing that needs to be watched is the ever growing size of the database.

You'll probably generate several templates before you finally settle on exactly what you want; the same goes for snippets and chunks. Its a good idea to remove those you discard as you go along. (If you don't you may end up with lots of different variants, and be unable to remember which are in use and which aren't. I know I ended up with that problem.) This is a minor problem though - there are two other processes that will cause the database to continually enlarge - the audit log in the manager, and, if you enable it, the visitor log. These shouldn't be allowed to grow indefinitely.

Restricting the logs

Both the audit log and the visitor log should be regularly pruned in order to avoid excessive growth. If you have enabled the visitor log, this is the one that is likely to grow the fastest, and may eventually begin to have an impact on performance.

Entries are made in the audit log every time someone logs into the manager and does anything. To see what sort of things are logged:

This will give you a list of everything that has been done using the manager since the log was last purged. As you can see, this is a fairly detailed list, so if the site is frequently updated the log will grow in size. If its getting too big, go through the three steps above, and then look at the intial prargraph of text above the list of actions. The word 'empty' is an aactive link, that will empty the audit log, deleting the contents of that table.

If you have enabled visitor logging, every time a user reads a page from the site, an entry is made in one or more tables in the visitor log set. (These tables all begin <prefix>_log_ .) These tables will obviously grow faster on a busy site, and can rapidly reach over 50% of the whole database. Worse, every time a user reads a page, part of the processing is to add to these logs, adding to the time taken to serve up the page, and the added overhead increases as the table size increases. To stop this becoming too big a problem you need to regularly purge these tables. This is a manual process at present, involving use of your database control application to delete the contents of these tables.

Index statistics

Many of the tables in the database are indexed, to allow the DBMS to more quickly find the records it wants from within the table. The DBMS maintains statistics on the index so that it can decide what is the best way to search through the index to find the matching records. (For example, if there are only two records, then a sequential search of the index is going to be quicker than any complex algorithm; if there are 10 million records, a sequential search is going to be s....l....o...w!) The statistics are not updated every time a record is added; you need to update the statistics regularly. (This is particularly important for large tables that are frequently accessed ... like the _log_ tables used for visitor logging.)

Fortunately, its very easy to update the statistics ... all you need to do is:

 This will free up the unused memory for the table, and more importantly update the statistics as a side effect. (Alternatively, your database management interface should allow you to update statistics directly.)

It is also a good idea to periodically issue a 'repair tables' command through your database management interface. The details will vary depending on what interface your host provides. 


Hosting Costs Generously Subsidized By:
Hydraulikservice | Andreas Lewicki