In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "Why the PostgreSQL checkpointer background process uses so much memory". The explanation in the article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "Why the PostgreSQL checkpointer background process uses so much memory"!
This section is based on a question from PGer:
Q:
Why do checkpointer background processes use so much memory?
[pg12@localhost ~] $ps-aux | grep postgrespg12 1506 0.01.8 753156 34704? Ss 10:30 0:00 / appdb/xdb/pg12beta1/bin/postgrespg12 1507 0.0 0.0 187304 1472? Ss 10:30 0:00 postgres: logger pg12 1509 0.0 24.1 754120 452672? Ss 10:30 0:04 postgres: checkpointer pg12 1510 0.0 28.4 753292 533184? Ss 10:30 0:08 postgres: background writer pg12 1511 0.0 0.9 753260 18012? Ss 10:30 0:11 postgres: walwriter pg12 1513 0.0 0.0 189420 1448? Ss 10:30 0:00 postgres: archiver last was 00000001000000020000005Cpg12 1514 0.0 0.0 189556 1324? Ss 10:30 0:00 postgres: stats collector pg12 1515 0.0 0.1 753688 1984? Ss 10:30 0:00 postgres: logical replication launcher pg12 2281 0.0 112660 972 pts/3 S+ 16:38 0:00 grep-- color=auto postgres [pg12@localhost ~] $grep 'shared' $PGDATA/postgresql.conf shared_buffers = 512MB # min 128kB#shared_memory_type = mmap # the default is the first optiondynamic_shared_memory_type = posix # the default is the first option#wal_buffers =-1 # min 32kB -1 sets based on shared_buffers#shared_preload_libraries =''# (change requires restart)
For example, the shared memory is set to 512MB, and the checkpointer and background writer processes occupy about 25% of the memory on machines with 2 GB of memory.
A:
Resident "RAM of a postgres subprocess is often just be the fraction of shared_buffers it's read/written. Checkpointer must necessarily read all dirty pages from Smurb and write out to disk (by way of page cache), so that's why its RSS is nearly 32GB. And the recovery process is continuously writing into Smurb.
The reason is that checkpointer and bg writer need to read data from shared memory (from Smurb to page cache) and flush it to disk, thus giving people the illusion of taking up a lot of memory.
Thank you for reading, the above is the content of "Why PostgreSQL checkpointer background processes use so much memory". After the study of this article, I believe you have a deeper understanding of why PostgreSQL checkpointer background processes use so much memory, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.