Thread: memory question

memory question

From
"Ed L."
Date:
I have an HP ia64 11.23 server with 16gb of RAM running 6 pgsql clusters.  I'm seeing this old error when attempting to restart a legacy 7.3.4 cluster after a power outage:
 
--------------------
./postmaster successfully started
IpcMemoryCreate: shmget(key=9099001, size=110002176, 03600) failed: Not enough space
 
This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space.
To reduce the request size (currently 110002176 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 10000) and/or
its max_connections parameter (currently 60).
 
The PostgreSQL Administrator's Guide contains more information about
shared memory configuration.
------------------
 
Glance (and GBL_MEM_UTIL) say ~80% of RAM is being used:
 
Total VM :  6.98gb   Sys Mem  :  3.48gb   User Mem:  6.40gb   Phys Mem:  16.0gb
Active VM:  5.94gb   Buf Cache:  3.20gb   Free Mem:  2.91gb         Page 1 of 1
UserMem + SysMem + BufCache = ~80%, but that would leave 2.91gb "free"?
 
I don't understand why pgsql is not able to satisfy this 110MB request, either by utilizing the free memory reported by glance, or by giving up some up from the 3.2gb os buffer cache (we have dbc_min_pct = 3%, or 480mb, and dbc_max_pct = 20%, or 3.2gb, not a static os buffer cache).
 
[As an aside, the 'sz' column from 'ps -elf' adds up to 4.4gb @ 4096b/page.  Also wondering how that fits with the 6.4gb of User Mem shown above.]
 
Thanks,
Ed
 
 

Re: memory question

From
"Ed L."
Date:
 
IpcMemoryCreate: shmget(key=9099001, size=110002176, 03600) failed: Not enough space
 
This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space.
To reduce the request size (currently 110002176 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 10000) and/or
its max_connections parameter (currently 60).
 
Glance (and GBL_MEM_UTIL) say ~80% of RAM is being used:
 
Total VM :  6.98gb   Sys Mem  :  3.48gb   User Mem:  6.40gb   Phys Mem:  16.0gb
Active VM:  5.94gb   Buf Cache:  3.20gb   Free Mem:  2.91gb         Page 1 of 1
UserMem + SysMem + BufCache = ~80%, but that would leave 2.91gb "free"?
 
I don't understand why pgsql is not able to satisfy this 110MB request, either by utilizing the free memory reported by glance, or by giving up some up from the 3.2gb os buffer cache (we have dbc_min_pct = 3%, or 480mb, and dbc_max_pct = 20%, or 3.2gb, not a static os buffer cache).
 
I also see the sum of shared memory segments from ipcs adds up to 3.4gb.
 
So ps + ipcs = 7.8gb if pgsize = 4K.  If pagesize = 3001, ps + ipcs = 6.6gb, pretty close to the 6.40gb above.
 
But still wondering why 110mb request cannot be satisfied from 2.91gb of free mem or 3.2gb os buffer cache? 
 
Thanks,
Ed
 

Re: memory question

From
Tom Lane
Date:
"Ed L." <pgsql@bluepolka.net> writes:
> But still wondering why 110mb request cannot be satisfied from 2.91gb of =
> free mem or 3.2gb os buffer cache?

Presumably, the shmem segments already in existence are eating almost
all of your kernel SHMMAX limit.

            regards, tom lane