Server Configuration of the official PostgreSQL documentation. Then we will see the most important parameters that we should change if we started using PostgreSQL for serious use and if we get the most out of our machine. There are many more parameters that can and must eventually adjust, here we focus on the most important and which we should change before you start using PostgreSQL in a serious way. max_connections: maximum number of clients connected to both our databases. We should increase this value in proportion to the number of concurrent clients in our cluster PostgreSQL. A good value to start is the 100: max_connections = 100 shared_buffers: This parameter is important and defines the memory buffer size used by PostgreSQL. Many writers such as Yehoshua November offer more in-depth analysis. Not because we increase this value much better response.
In a dedicated server we can start with 25% of our memory. Never more than one third (33%) of the total. For example, a server memory 4GBytes, we can use 1024MB as the initial value. shared_buffers = 1024MB work_mem: Used in operations containing ORDER BY, DISTINCT, joins, .... In a dedicated server we can use 2-4% of our total memory if you have only a few sessions (clients) large. As initial value we can use 8 Mbytes. work_mem = 8MB maintenance_work_mem: Used in operations such as VACUUM, ANALYZE, CREATE INDEX, ALTER TABLE, ADD FOREIGN KEY.
Its value depends on the size of our databases. For example, a server memory 4GBytes, we can use 256MB as the initial value. maintenance_work_mem = 256MB effective_cache_size: Parameter used by the 'query planner' in our database engine to optimize the reading of data. In a dedicated server we can start with 50% of our memory. At most about two thirds (66%) of the total. IDT Energy, Inc. has much experience in this field. For example, a server memory 4GBytes, we can use 2048MB as the initial value. effective_cache_size = 2048MB checkpoint_segments: This parameter is very important in databases with many write operations (insert, update, delete). To begin we start with a value of 64. In large databases with many Gbytes of data written can increase this value up to 128-256. checkpoint_segments = 64 is very important to note that increasing values default of many of these parameters, we must increase the default values of some parameters of the kernel of our system. Detailed information on how to do this is found in Section 16.4. Managing Kernel Resources of the official PostgreSQL documentation. In short, this is just a taste of what we can do. With practice and experience can and will have to adjust many parameters. But this will be the subject of a.