Maintenance tasks

This documentation discusses tasks that you need to perform to run Matrix on your server, and how to improve the performance of your server.

Trash

The trash is similar to the trash functionality found in many operating systems. Items placed in the trash are not deleted immediately, but remain in the Matrix system until the trash is purged.

It is important to purge the trash regularly since a build-up of items in the trash can cause the system to slow down, and when you eventually purge the trash it will take much longer.

Read the Trashing and purging assets documentation for more information.

HIPOs

HIPO management is performed through the HIPO herder screen, which is described in the Concepts documentation.

HIPO jobs sometimes become detached from the process that started them, and never fully complete. However, an incomplete HIPO will not corrupt the system as HIPOs are run in database transactions. The HIPO herder lists all such unclaimed HIPOs and allows you to delete them.

Ensure the HIPO has actually finished before you delete it; some HIPOs do take a long time to complete. Any HIPO that is showing 100% has completed successfully, but has failed to detach itself from the system and is safe to delete. In addition, any HIPO older than a few hours is also safe to delete.

Select the box next to the HIPO process and click Save to delete it.

Server maintenance

The following tasks should be performed to maintain your system:

System log files

Matrix maintains two log files in the directory /home/websites/squiz_Matrix/data/private/logs, which can be used to help troubleshoot problems that may have occurred.

These files are:

error.log

All PHP errors are logged in this file. This includes any system or database access errors that appear at the top of the user’s screen within Matrix.

cron_errors.log

All cron job errors are logged in this file.

system.log

All Matrix generated messages are logged in this file. This includes the creation of new assets, attribute changes and configuration changes.

asset_cache.log

When the SQ_CONF_DEBUG configuration setting is enabled in the system’s main.inc file, Matrix will log internal caching information in this file, specifically any internal cache objects that were not cleared correctly. This log is used for development purposes only. Read the main.inc configuration documentation for more information on the SQ_CONF_DEBUG setting.

search.log

All search queries and results for the Matrix search page are logged in this file.

funnelback.log

Generated after reindexing the Funnelback manager. This log file contains information on the funnelback engine and logs funnelback errors on the system.

performance.log

Performance alerts are logged in this file. This includes when a listing asset, such as an asset listing page, attempts to list over 1000 items on a single page. This log is used by system administrators to quickly determine any obvious performance issues on the system.

The location of the two log files can be changed in the main configuration file; /home/websites/squiz_Matrix/data/private/conf/main.inc

In addition, there are apache log files, which are usually stored in the following directories:

Debian and Apache1

/var/log/apache

Debian and Apache2

/var/log/apache2

RHEL

/var/log/httpd

Log file rotation

Apache logs and Matrix logs should be rotated at appropriate intervals, based on the growth rate of the logs, which depends on how busy the site is.

In general, Apache logs are usually rotated on a daily or weekly schedule, with old logs being compressed to reduce their on-disk size.

The unix utility logrotate is the most commonly used program and it is fairly straightforward to install and configure. In addition, the logrotate man file is comprehensive.

Following are examples logrotate configurations:.

Debian and Apache1
/var/log/apache/*.log {
  Weekly
  Missingok
  Rotate 16
  Compress
  Delaycompress
  Notifempty
  Create 660 www-data www-data
  Sharedscripts
  Postrotate
    If [ -f /var/run/apache.pid ]; then
      /Etc/init.d/apache restart > /dev/null
    Fi
  Endscript
}
Debian and Apache2
/var/log/apache2/*.log {
  Weekly
  Missingok
  Rotate 16
  Compress
  Delaycompress
  Notifempty
  Create 660 www-data www-data
  Sharedscripts
  Postrotate
    If [ -f /var/run/apache2.pid ]; then
      /Etc/init.d/apache2 restart > /dev/null
    Fi
  Endscript
}
RHEL
/var/log/httpd/*log {
  Missingok
  Compress
  Notifempty
  Sharedscripts
  Postrotate
  /Bin/kill -hup `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
  Endscript
}

PHP

Old PHP sessions are not always cleaned automatically, and you may want to periodically purge old session files, by setting up a cron job to run the script session_cleanup.sh.

Removing active session files will forcibly logout any user that is currently logged in.

Webstats

When installing a web statistics program, you will normally be required to add an entry to cron to initiate a collection and reporting run. These programs are often io intensive, and can have a negative impact on the performance of your site.

It is recommended that you run accounting and statistical reporting programs at a time when your server is at its quietest (for example, between 2:30 AM and 3:30 AM).

File change detection tool

You may wish to configure a file change detection tool for a number of reasons:

  1. To watch for any changes that you or your users may have made to the Matrix tree.

  2. To monitor temp and log directories for unusual entries.

  3. To ensure general system integrity.

Squiz recommends the use of AIDE. Visit http://aide.sourceforge.net/ for more information.

Performance issues

The following areas can be looked at to increase the performance of your system.

Increasing memory limit

If you find that you are getting errors indicating that the memory limit has been exceeded while performing certain intensive tasks (such as design parsing), you can increase the memory allocated by modifying a Matrix source file. In the file /data/private/conf/main.inc, you can set the amount of memory that Matrix uses:

define('SQ_CONF_WEB_MEMORY_LIMIT', 64);
define('SQ_CONF_CRON_MEMORY_LIMIT', 64);

When changing this setting, it is recommended to change it in small increments of 32 MB at a time to find an appropriate memory usage level. These memory limits can also be changed on the system configuration screen.

Read the System configuration documentation for more information.

Squiz server

Squiz server is a daemon process that operates separately from Matrix, and is used primarily for intensive processing tasks, most commonly HIPOs.

When a HIPO is ready to be processed, Matrix connects to squiz server, which then takes on the role of processing the task, thus avoiding the performance restrictions of being run inside a web browser.

Using Squiz server for these tasks greatly speeds up any Matrix task, which requires HIPOs.

PHP caching

PHP caching software keeps regularly accessed PHP scripts compiled in memory, and can greatly improve performance of Matrix.

Matrix has been tested using APC, but other solutions are available such as:

Postgresql

The default settings on installation of postgresql generally will not give you optimal performance for your system as they are machine dependant. You should follow the tuning guidelines for your particular server. You can find information on tuning different servers at http://archives.postgresql.org/pgsql-performance/.

It is also recommended you regularly vacuum your database. Once the size of your database increases, a regular vacuum can offer reference linkable performance increases. By default your system is configured to run the autovacuum script to do this automatically.

© 2015- Squiz Pty Ltd