Web server logs - 596 CHAPTER 26 POSTGRESQL ADMINISTRATION Table 26-3.
596 CHAPTER 26 POSTGRESQL ADMINISTRATION Table 26-3. OS-Specific Methods for Starting PostgreSQL Operating System Alternative Start/Stop Method Debian Provides a pg_ctlcluster script to control different PostgreSQL options FreeBSD Provides a script in /etc/rc.d called 010.pgsql.sh Red Hat Provides a standard init script called postgresql, available in /etc/init.d/ Windows Provides shortcuts in the Start menu, and can also be controlled from the Services menu Tuning Your PostgreSQL Installation Once you have your PostgreSQL server up and running, you will want to look into tuning your installation for maximum performance. This is accomplished by changing parameters within the postgresql.conf configuration file, which is normally found within the PGDATA directory of your PostgreSQL installation. As of PostgreSQL 8.0, there were more than 100 different options for configuring your PostgreSQL server; however, only a small set of those is needed for tuning. In this section, we walk through the most important options for configuring PostgreSQL. Managing Resources The first group of settings we look at focuses on managing the amount of resources your PostgreSQL server will use. Because PostgreSQL is designed to run on minimal hardware, the default settings can often be considerably low for running on modern hardware. For this reason, these settings are generally the first things you will want to adjust on your system. shared_buffers The shared_buffers setting controls the amount of shared memory used by PostgreSQL. Its value is a number where 1 unit represents 8,192 bytes of memory. The minimum is 16, or twice the number of maximum allowed connections, whichever is greater; the default is typically 1,000. For tuning, many people suggest setting this parameter to a value equal to 20 percent of the RAM that will be dedicated to PostgreSQL and then adjusting down to find the best performance for your workload. General usage has demonstrated that increasing this value over 10,000 is usually not helpful, so on systems with large amounts of RAM, you might want to start at this level. This value requires a full restart of PostgreSQL for any changes to take effect. work_mem This setting, also known as sort_mem prior to version 8, controls the amount of memory that can be used for internal sort operations and hash tables before these operations switch to using temporary disk files. Its value is a number equivalent to 1KB; the default value is 1024KB (1MB). While it is optimal to avoid using disk files where possible, it is important to remember that this setting operates per sort, not per query, so setting the value too high can cause your system to dedicate too much memory to a given query. Consider an example in which you have a query that involves joining two tables with a hash-join, returning a distinct result set, which in turn is ordered by an arbitrary column in the result. This single query would involve at least three sort operators, and so would allow up
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.