Re: [HACKERS] Shared memory estimation for postgres

2016-11-12 Thread Andres Freund
On 2016-11-11 09:56:21 +0900, Michael Paquier wrote: > On Fri, Nov 11, 2016 at 8:40 AM, leoaaryan wrote: > > The easiest way to find the value for the shared memory computation is to > > change the logging level to DEBUG3 and start postgres DB engine and it will > > give the calculated value in th

Re: [HACKERS] Shared memory estimation for postgres

2016-11-11 Thread Craig Ringer
On 11 Nov. 2016 13:00, "leoaaryan" wrote: > > Hi Michael, > > Thanks for all the help and time. I have already developed a code where I > can exactly calculate the to be allocated shared memory value based on the > Postgres 9.5.4 code (i went through the code, found out the sizes and offset > of a

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread leoaaryan
Hi Michael, Thanks for all the help and time. I have already developed a code where I can exactly calculate the to be allocated shared memory value based on the Postgres 9.5.4 code (i went through the code, found out the sizes and offset of all the structures used in the memory calculation process

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread Michael Paquier
On Fri, Nov 11, 2016 at 1:26 PM, leoaaryan wrote: > I think the method "pg_get_shmem_allocations" mentioned in the patch will > give the allocated shared memory when the postgres db server is running. I'm > trying to get the same without running the server if possible. That's up to "read the code

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread leoaaryan
Hi Craig, Sorry for the multiple point of contact for the same question. I'll keep in mind to attach similar corresponding links in future if any. http://stackoverflow.com/questions/39607940/is-it-possible-to-know-the-memory-being-allocated-by-the-method-createsharedmem and http://stackoverflow.c

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread leoaaryan
Hi Michael, I think the method "pg_get_shmem_allocations" mentioned in the patch will give the allocated shared memory when the postgres db server is running. I'm trying to get the same without running the server if possible. Please correct me if I have failed to understand the discussion thread

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread Craig Ringer
On 11 November 2016 at 06:57, leoaaryan wrote: > I am a newbie to databases and Postgres and I am trying to analyze the shared > memory being calculated and allocated by Postgres in the method > "CreateSharedMemoryAndSemaphores" for different major versions for different > postgres.conf file Note

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread Michael Paquier
On Fri, Nov 11, 2016 at 8:40 AM, leoaaryan wrote: > The easiest way to find the value for the shared memory computation is to > change the logging level to DEBUG3 and start postgres DB engine and it will > give the calculated value in the log file. > > I believe postgres as a DB needs to be runnin

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread leoaaryan
Hi Jay, If you are talking about http://evol-monkey.blogspot.com/2013/08/setting-sharedbuffers-hard-way.html and the "pg_buffercache" extensions then yes I have gone through it. The easiest way to find the value for the shared memory computation is to change the logging level to DEBUG3 and start

Re: [HACKERS] Shared memory estimation for postgres

2016-11-10 Thread John Scalia
Do a web search on setting shared memory the hard way, and I think you'll see what you really need to do. -- Jay Sent from my iPad > On Nov 10, 2016, at 5:57 PM, leoaaryan wrote: > > I am a newbie to databases and Postgres and I am trying to analyze the shared > memory being calculated and all

[HACKERS] Shared memory estimation for postgres

2016-11-10 Thread leoaaryan
I am a newbie to databases and Postgres and I am trying to analyze the shared memory being calculated and allocated by Postgres in the method "CreateSharedMemoryAndSemaphores" for different major versions for different postgres.conf file My idea was to create a utility in Postgres and calll out th