[pgpool-general: 8212] Re: Pgpool Memory Requirement

Bo Peng pengbo at sraoss.co.jp
Fri Jun 10 09:21:10 JST 2022


Hello,

> Hello Bo,
> 
> Thanks for your reply.
> 
> Could you describe the formula by which the calculation is made in your 
> letter.
> Where is the Shared Memory calculation here and where is the Processing 
> Memory.

If your settings are:

    num_init_children = 1000
    max_pool=1

Shared memory requirement (in mega bytes) = 10 + 1000 * 1 * 0.02 = 30MB
Process memory requirement in total (in mega bytes) = 1000 * 0.16 = 160MB

The requried memory is: 30MB + 160MB = 190MB

> On 09.06.2022 17:05, Bo Peng wrote:
> > Hello,
> >
> >> Pgpool works as load balancer in Kubernetes with 3 replicas. Docker
> >> image pgpool/pgpool:4.2.2 is used.
> >>
> >> The section "7.1.1. Memory Requirement" of Pgpool documentation
> >> specifies an amount of memory is required.
> >>
> >> According to formulas there if I need 1000 of num_init_children with
> >> max_pool=1 , the amount of Shared Memory should be
> >>
> >> 1000*1*17408 Bytes = 17 MB. That's not a lot for Shared Memory.
> >>
> >> In addition  Process Memory is calculated as num_init_children * 5 MB.
> >> In my case it reaches 5000MB or 5GB.
> >>
> >> My question is:
> >> Should we assign such an amount of memory for the pod in k8s in which
> >> the Pgpool docker image works, given that we use Pgpool exclusively as a
> >> load balancer?
> > Sorry. There was a bug in the document "Memory Requirement" section.
> >
> > It's fixed in the following commit:
> > https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=2b0f513430bab8b1d7898291638b335e8f04a76d
> >
> > Let me answer your question.
> >
> > If you settings is:
> >
> >    num_init_children = 1000
> >    max_pool=1
> >
> > The requried memory is:
> >
> >    10 + 1000 * 1 * 0.02  + 1000 * 0.16 = 30MB + 160MB = 190MB
> >
> > Best regards,


-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan
https://www.sraoss.co.jp/


More information about the pgpool-general mailing list