作者:Cary Huang
简介:资深软件开发工程师,2012年获得University of British Columnbia(UBC)电气工程学士学位,有超过8年的C/C++开发经验,在如下领域有丰富的实践经验:PostgreSQL和非关系数据库、Docker部署管理、软件工程生命周期、身份验证、密码学等。
1.简介
2. BgWriter(Background Writer)进程
# - Background Writer -#bgwriter_delay = 200ms # 10-10000ms between rounds#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round#bgwriter_flush_after = 512kB # measured in pages, 0 disables
3. WalWriter进程
#-----------------------------------------------------------------------------# WRITE-AHEAD LOG#-----------------------------------------------------------------------------# - Settings -wal_level = logical # minimal, replica, or logical# (change requires restart)#fsync = on # flush data to disk for crash safety# (turning this off can cause# unrecoverable data corruption)#synchronous_commit = on# synchronization level; # off, local, remote_write, remote_apply, or on#wal_sync_method = fsync # the default is the first option# supported by the operating system:# open_datasync# fdatasync (default on Linux)# fsync# fsync_writethrough# open_sync#full_page_writes = on # recover from partial page writes#wal_compression = off # enable compression of full-page writes#wal_log_hints = off # also do full page writes of non-critical updates# (change requires restart)#wal_init_zero = on # zero-fill new WAL files#wal_recycle = on # recycle WAL files#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers# (change requires restart)#wal_writer_delay = 200ms # 1-10000 milliseconds#wal_writer_flush_after = 1MB # measured in pages, 0 disables#commit_delay = 0 # range 0-100000, in microseconds#commit_siblings = 5 # range 1-1000
4. PgArch进程
# - Archiving -#archive_mode = off # enables archiving; off, on, or always# (change requires restart)#archive_command = '' # command to use to archive a logfile segment# placeholders: %p = path of file to archive# %f = file name only# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p/mnt/server/archivedir/%f'#archive_timeout = 0 # force a logfile segment switch after this# number of seconds; 0 disables
5. AutoVacuum 进程
#-----------------------------------------------------------------------------# AUTOVACUUM#-----------------------------------------------------------------------------#autovacuum = on # Enable autovacuum subprocess? 'on'# requires track_counts to also be on.#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and# their durations, > 0 logs only# actions running at least this number# of milliseconds.#autovacuum_max_workers = 3 # max number of autovacuumsubprocesses# (change requires restart)#autovacuum_naptime = 1min # time between autovacuum runs#autovacuum_vacuum_threshold = 50 # min number of row updates before# vacuum#autovacuum_analyze_threshold = 50 # min number of row updates before# analyze#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum# (change requires restart)#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age# before forced vacuum# (change requires restart)#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for# autovacuum, in milliseconds;# -1 means use vacuum_cost_delay#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for# autovacuum, -1 means use# vacuum_cost_limit
6. Stat Collector
#------------------------------------------------------------------------------# STATISTICS#------------------------------------------------------------------------------# - Query and Index Statistics Collector -#track_activities = on#track_counts = on#track_io_timing = off#track_functions = none # none, pl, all#track_activity_query_size = 1024 # (change requires restart)#stats_temp_directory = 'pg_stat_tmp'
7. Checkpointer 进程
# - Checkpoints -#checkpoint_timeout = 5min # range 30s-1dmax_wal_size = 1GBmin_wal_size = 80MB#checkpoint_completion_target = 0.5# checkpoint target duration, 0.0 - 1.0#checkpoint_flush_after = 256kB # measured in pages, 0 disables#checkpoint_warning = 30s # 0 disables
8.共享内存和本地内存
9.总结
I Love PG
关于我们
中国开源软件推进联盟PostgreSQL分会(简称:中国PG分会)于2017年成立,由国内多家PostgreSQL生态企业所共同发起,业务上接受工信部中国电子信息产业发展研究院指导。中国PG分会是一个非盈利行业协会组织。我们致力于在中国构建PostgreSQL产业生态,推动PostgreSQL产学研用发展。
技术文章精彩回顾 PostgreSQL学习的九层宝塔 PostgreSQL职业发展与学习攻略 2019,年度数据库舍 PostgreSQL 其谁? Postgres是最好的开源软件 PostgreSQL是世界上最好的数据库 从Oracle迁移到PostgreSQL的十大理由 从“非主流”到“潮流”,开源早已值得拥有 PG活动精彩回顾 创建PG全球生态!PostgresConf.CN2019大会盛大召开 首站起航!2019“让PG‘象’前行”上海站成功举行 走进蓉城丨2019“让PG‘象’前行”成都站成功举行 中国PG象牙塔计划发布,首批合作高校授牌仪式在天津举行 群英论道聚北京,共话PostgreSQL 相聚巴厘岛| PG Conf.Asia 2019 DAY0、DAY1简报 相知巴厘岛| PG Conf.Asia 2019 DAY2简报 独家|硅谷Postgres大会简报 直播回顾 | Bruce Momjian:原生分布式将在PG 14版本发布 PG培训认证精彩回顾 中国首批PGCA认证考试圆满结束,203位考生成功获得认证! 中国第二批PGCA认证考试圆满结束,115位考生喜获认证! 重要通知:三方共建,中国PostgreSQL认证权威升级! 近500人参与!首次PGCE中级、第三批次PGCA初级认证考试落幕! 2020年首批 | 中国PostgreSQL初级认证考试圆满结束 一分耕耘一分收获,第五批次PostgreSQL认证考试成绩公布
文章转载自开源软件联盟PostgreSQL分会,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





