Re: Shared memory usage calculations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Shared memory usage calculations
Date: 2009-10-10 18:39:38
Message-ID: 17239.1255199978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Thom Brown <thombrown(at)gmail(dot)com> writes:
> 2009/10/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> Clearly wrong compared to what --- ie, what's the actual size of your
>> shared memory segment? (See ipcs)

> I don't actually know the size of my shared memory segment. "sysctl -a |
> grep -i shmseg" doesn't return anything as it hasn't been set, and not sure
> how to find out the default value.

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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Thom Brown 2009-10-10 18:45:45 Re: Shared memory usage calculations
Previous Message Thom Brown 2009-10-10 14:29:31 Re: Shared memory usage calculations