Software Configuration Files

Last Updated: 21 Oct 2016

Bookmarks

The following configuration files are important for Squiz Matrix.

Area File Described in
Squiz Matrix <systemroot>/data/private/conf/main.inc Refer to the Annotated main.inc chapter in this manual for details of the variables within this file.
PHP php.ini

The location of this file will vary depending on where php is installed on your system.

If you are running ssh, you can locate this file using the following command:

php -i | grep php.ini 


This file is often located in the following directories:

Debian:


/etc/php5/apache – Squiz Matrix uses these settings.

/etc/php5/cli – back end scripts and Squiz Server use these settings.

RHEL:


/etc – Squiz Matrix back end scripts and Squiz Server all use these settings.
The required variables are described in this chapter.
Postgres postgresql.conf

This file is usually located in the following directories:

Debian:


/etc/postgresql/8.1/main

RHEL:


/var/lib/pgsql/data/

Installation of Postgres is described on the PostgreSQL DB Setup Guide on the Squiz Matrix site.

Suggestions for tuning your installation are described in this chapter.

Unix Kernel /etc/sysctl.conf Suggested changes that can be made to kernel settings to increase in performance are included in this chapter.
Apache The apache configuration file is usually located in the following directories:

Debian& Apache 1.3:


/etc/apache/httpd.conf

Debian& Apache 2.x:


/etc/apache2/httpd.conf

RHEL:


/etc/httpd/conf/httpd.conf
Refer to the Manual Installation Guide on the Squiz Matrix site for details of the configuration required in this file. 

PHP Setup

PHP configuration is set in the file php.ini. The following settings are required:

  • file_uploads = On: this allows for HTTP file uploads
  • upload_max_filesize = 20M: maximum allowed size for uploaded files. This should match the post_max_size

Postgres Performance

Default Locale

For performance reasons, it is recommended that you change the default locale from utf-8 to C. This can be done in many ways, however it is recommended that you do this before installing postgres.
To see what locale is currently set in your environment, you can run the `locale` command:

#> locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Debian

#> export LANG=C
#> export LANGUAGE=C

This can also be done in /etc/environment

RedHat

In the file /etc/sysconfig/i18n change LANG to an undefined variable, for example:

LANG=""

Postgres Configuration File

The postgres configuration file is postgresql.conf. It contains many options that can either improve or impair to the performance of the database. See http://www.postgresql.org/docs/<postgres version>/static/runtime-config.html for more details about the specific options and http://archives.postgresql.org/pgsql-performance/ for general performance tuning.

As a guide, the following settings are important:

Variable Type Description
max_connections integer The maximum number of concurrent connections to the database server.
superuser_reserved_connections integer This many connections, out of max_connections,are reserved for the superuser. (leaves 48 general connections)
shared_buffers integer The number of shared memory buffers used by the database server. Minimum is 2 X max_connections
max_prepared_transactions integer The maximum number of transactions that can be in the "prepared" state simultaneously
work_mem integer The amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files
maintenance_work_mem integer The maximum amount of memory to be used in maintenance operations
max_fsm_pages integer Maximum number of disk pages for which free space will be tracked in the shared free-space map
max_fsm_relations integer Maximum number of relations (tables and indexes) for which free space will be tracked in the shared free-space
space map fsync boolean

Enforce that data is written to disk.

checkpoint_segments integer Maximum distance between automatic WAL checkpoints
checkpoint_timeout integer Maximum time between automatic WAL checkpoints (seconds)
effective_cache_size floating point Increase to the max of free ram to boost your db ( 8192 * 8k = 65536k = 64M )
stats_start_collector boolean Starts the statistics-collection subprocess
stats_row_level boolean Enable the collection of row-level statistics on database activity, useful for tuning
autovacuum boolean Enable autovacuum subprocess
lc_messages string Sets the language in which messages are displayed
lc_monetary string Sets the locale to use for formatting monetary amounts
lc_numeric string Sets the locale to use for formatting numbers
lc_time string Sets the locale to use for formatting date and time values

We recommend that you adjust these values according to your available system resources and database requirements.

Kernel Settings

There are a number of changes that can be made to kernel settings that can also provide an increase in performance. For more details, Refer to http://www.postgresql.org/docs/current/static/kernel-resources.html.

/etc/sysctl.conf

The following settings are suggested, depending on the hardware of your server:

  • kernel.shmmax = 536870912: half of the RAM if the system is stand-alone db-server, otherwise only 128 MB
  • kernel.sem = 100 32000 100 100: no change
  • kernel.shmmni = 4096: ( postgres.conf:shared_buffers / 16 )
  • kernel.shmall = 67108864: ( kernel.shmmax / pages_size ) presume page-size= 8k

Next Chapter

The Latest

Let Us Know What You Think

Let us know if you spot any errors or if you have any ideas on how we can improve the Matrix Community Website.

Contact Squiz for Demo

Let us show you the true power of Squiz Matrix by giving you a personalised demonstration.