In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the parameter settings of the PostgreSQL database". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the parameter settings of the PostgreSQL database".
Suppose the database host OS is Linux 64bit, the memory is 8G, the storage array uses RAID 5 (the bandwidth is about 200MB), and the host has no other services.
I. the general part
Listen_addresses
# PG listens for local connections by default. To accept connection requests from other Client, modify it to * listen_addresses ='*'.
Max_connections
# maximum number of connections, default is 100. according to business application and host configuration settings # because PG uses multi-process mode, such as when the number of connections is greater than a certain number (related to machine configuration), the performance will degrade due to frequent switching of process context # if you need to support thousands of connections, you can consider using sub-library read-write separation and connection pooling components (such as PgBouncer) max_connections=256
View the SQL of current connections:
Testdb=# SELECT sum (numbackends) FROM pg_stat_database; sum-1 (1 row) II. Memory dependent
Assuming that the machine memory is N, the following requirements need to be met:
N > max_connections x work_mem + shared_buffers + temp_buffers + maintenance_work_mem + OS running minimum required memory
Shared_buffers
# shared buffer to configure the memory size available for Cache Data (including Hot Data/Index, etc.) # generally set to 25%-40%shared_buffers=3G of host memory
Effective_cache_size
# after excluding the memory available to the operating system and other applications, it is expected that the operating system and the database itself can be used to cache data # this parameter is only used in the optimized estimate (evaluation) phase. If there is a misunderstanding that affects the optimizer's judgment, an unreasonable execution plan is obtained. # for example, on a host with only 512m, set this parameter to 4G and query a large table with an index. If the size of the index accessed is the SQL statement log_min_duration_statement= 1s defined by this value, use it with caution
Synchronous_commit
# whether to wait for WAL data to be written to disk before returning success. Optional values are on, remote_apply, remote_write, local, off. The default is set on#synchronous_commit to off, which may result in a transaction that is successful but not actually persisted.
Commit_delay/commit_siblings
# commit_delay: the interval between wal_buffer and wal_buffer when the log is written to disk after the transaction is committed # commit_siblings: the number of concurrent transactions that trigger commit_delay waiting, such as the number of concurrent transactions
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.