Skip site navigation (1) Skip section navigation (2)

Re: Shared memory usage calculations

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Shared memory usage calculations
Date: 2009-10-10 18:45:45
Message-ID: bddc86150910101145i637d52ecreda9662538f0da81@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
2009/10/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

>
> There is no "default value", we are talking about the actual size of an
> actual memory object.  Which you find out with ipcs, not sysctl.
> For instance
>
> $ ipcs -a
>
> ------ Shared Memory Segments --------
> key        shmid      owner      perms      bytes      nattch     status
> 0x00530201 3080195    tgl       600        37904384   4
>
> ------ Semaphore Arrays --------
> key        semid      owner      perms      nsems
> 0x00530201 20873216   tgl       600        17
> 0x00530202 20905985   tgl       600        17
> 0x00530203 20938754   tgl       600        17
> 0x00530204 20971523   tgl       600        17
> 0x00530205 21004292   tgl       600        17
> 0x00530206 21037061   tgl       600        17
> 0x00530207 21069830   tgl       600        17
>
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
>
> (I'm running this postmaster as "tgl", not the more usual "postgres".
> On some platforms you might need to be the postgres user or root to see
> shared objects belonging to postgres.)
>
>                        regards, tom lane
>

My mistake.  I've never seen that before.  Running it on mine returns the
following:

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

0x0052e2c1 491520     postgres  600        235511808  4


------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x0052e2c1 8585218    postgres  600        17
0x0052e2c2 8617987    postgres  600        17
0x0052e2c3 8650756    postgres  600        17
0x0052e2c4 8683525    postgres  600        17
0x0052e2c5 8716294    postgres  600        17
0x0052e2c6 8749063    postgres  600        17
0x0052e2c7 8781832    postgres  600        17
0x0052e2c8 8814601    postgres  600        17
0x0052e2c9 8847370    postgres  600        17
0x0052e2ca 8880139    postgres  600        17
0x0052e2cb 8912908    postgres  600        17
0x0052e2cc 8945677    postgres  600        17
0x0052e2cd 8978446    postgres  600        17
0x0052e2ce 9011215    postgres  600        17
0x0052e2cf 9043984    postgres  600        17
0x0052e2d0 9076753    postgres  600        17
0x0052e2d1 9109522    postgres  600        17
0x0052e2d2 9142291    postgres  600        17
0x0052e2d3 9175060    postgres  600        17
0x0052e2d4 9207829    postgres  600        17
0x0052e2d5 9240598    postgres  600        17
0x0052e2d6 9273367    postgres  600        17
0x0052e2d7 9306136    postgres  600        17
0x0052e2d8 9338905    postgres  600        17
0x0052e2d9 9371674    postgres  600        17
0x0052e2da 9404443    postgres  600        17
0x0052e2db 9437212    postgres  600        17
0x0052e2dc 9469981    postgres  600        17
0x0052e2dd 9502750    postgres  600        17
0x0052e2de 9535519    postgres  600        17
0x0052e2df 9568288    postgres  600        17
0x0052e2e0 9601057    postgres  600        17
0x0052e2e1 9633826    postgres  600        17
0x0052e2e2 9666595    postgres  600        17
0x0052e2e3 9699364    postgres  600        17
0x0052e2e4 9732133    postgres  600        17
0x0052e2e5 9764902    postgres  600        17
0x0052e2e6 9797671    postgres  600        17
0x0052e2e7 9830440    postgres  600        17
0x0052e2e8 9863209    postgres  600        17
0x0052e2e9 9895978    postgres  600        17
0x0052e2ea 9928747    postgres  600        17
0x0052e2eb 9961516    postgres  600        17
0x0052e2ec 9994285    postgres  600        17
0x0052e2ed 10027054   postgres  600        17
0x0052e2ee 10059823   postgres  600        17
0x0052e2ef 10092592   postgres  600        17
0x0052e2f0 10125361   postgres  600        17
0x0052e2f1 10158130   postgres  600        17
0x0052e2f2 10190899   postgres  600        17
0x0052e2f3 10223668   postgres  600        17
0x0052e2f4 10256437   postgres  600        17
0x0052e2f5 10289206   postgres  600        17
0x0052e2f6 10321975   postgres  600        17
0x0052e2f7 10354744   postgres  600        17
0x0052e2f8 10387513   postgres  600        17
0x0052e2f9 10420282   postgres  600        17
0x0052e2fa 10453051   postgres  600        17
0x0052e2fb 10485820   postgres  600        17
0x0052e2fc 10518589   postgres  600        17

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

In any case, I gather that the documentation isn't inaccurate, rather my
interpretation is.  And having put my number of connections right up to
1500, Postgres still starts fine, so I'm not sure why I thought it would
cause the shared memory limit to be reached so easily.

Thanks

Thom

In response to

Responses

pgsql-docs by date

Next:From: Tom LaneDate: 2009-10-10 20:15:22
Subject: Re: Shared memory usage calculations
Previous:From: Tom LaneDate: 2009-10-10 18:39:38
Subject: Re: Shared memory usage calculations

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group