Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 02:22 AM
Josh Close
Guest
 
Posts: n/a
Default postgres start problems with memory

I keep getting this error.

DETAIL: Failed system call was shmget(key=5432001, size=34037760, 03600).
HINT: This error usually means that PostgreSQL's request for a shared
memory segment exceeded your kernel's SHMMAX parameter. You can
either reduce the request size or reconfigure the kernel with larger
SHMMAX. To reduce the request size (currently 34037760 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 2048) and/or its
max_connections parameter (currently 1024).
If the request size is already small, it's possible that it is
less than your kernel's SHMMIN parameter, in which case raising the
request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about
shared memory configuration.

I've change kernel.shmmax and kernel.shmmin a couple of times, and I
can't get it to work.

I'm passing

-N 1024
-B 2048

to postmaster, it's the gentoo install default. This is what I have
right now for kernel values

root # sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 31584400
kernel.shmmax = 31584400

Does the amount of RAM in the computer make a difference? I added more
RAM recently and upped the kernel to 4mb ram (something-or-rather) to
allow for over 1gig. It started up fine then. I restarted the computer
today and I can't get postgres to start now.

How can I fix this? What are some good standards? I've read this
http://www.postgresql.org/docs/7.4/i...resources.html
but it didn't help much.

Thanks.

-Josh

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

  #2  
Old November 23rd, 2005, 02:22 AM
Josh Close
Guest
 
Posts: n/a
Default Re: postgres start problems with memory

On Thu, 30 Sep 2004 13:39:57 -0500, Josh Close <narshe@gmail.com> wrote:[color=blue]
> I keep getting this error.
>
> DETAIL: Failed system call was shmget(key=5432001, size=34037760, 03600).
> HINT: This error usually means that PostgreSQL's request for a shared
> memory segment exceeded your kernel's SHMMAX parameter. You can
> either reduce the request size or reconfigure the kernel with larger
> SHMMAX. To reduce the request size (currently 34037760 bytes), reduce
> PostgreSQL's shared_buffers parameter (currently 2048) and/or its
> max_connections parameter (currently 1024).
> If the request size is already small, it's possible that it is
> less than your kernel's SHMMIN parameter, in which case raising the
> request size or reconfiguring SHMMIN is called for.
> The PostgreSQL documentation contains more information about
> shared memory configuration.
>
> I've change kernel.shmmax and kernel.shmmin a couple of times, and I
> can't get it to work.
>
> I'm passing
>
> -N 1024
> -B 2048
>
> to postmaster, it's the gentoo install default. This is what I have
> right now for kernel values
>
> root # sysctl -a | grep shm
> kernel.shmmni = 4096
> kernel.shmall = 31584400
> kernel.shmmax = 31584400
>
> Does the amount of RAM in the computer make a difference? I added more
> RAM recently and upped the kernel to 4mb ram (something-or-rather) to
> allow for over 1gig. It started up fine then. I restarted the computer
> today and I can't get postgres to start now.
>
> How can I fix this? What are some good standards? I've read this
> http://www.postgresql.org/docs/7.4/i...resources.html
> but it didn't help much.
>
> Thanks.
>
> -Josh[/color]

Ok. I got it started by changing

kernel.shmmax = 134217728
kernel.shmall = 134217728

Why does this make it work? wasn't it high enough before? I went by
the "reasonable value" that the postgres docs says of

250 kB + 8.2 kB * shared_buffers + 14.2 kB * max_connections up to infinity

but that didn't work.

Can anyone explain this to me? I'd like to be able to customize
postgresql, and I'm getting 2 gigs of ram to put in.

Thanks.

-Josh

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

  #3  
Old November 23rd, 2005, 02:22 AM
Greg Stark
Guest
 
Posts: n/a
Default Re: postgres start problems with memory


Josh Close <narshe@gmail.com> writes:
[color=blue]
> To reduce the request size (currently 34037760 bytes),[/color]
....[color=blue]
> root # sysctl -a | grep shm
> kernel.shmmni = 4096
> kernel.shmall = 31584400
> kernel.shmmax = 31584400[/color]

So it's currently looking for 34M and you're setting the maximum to 31M.

--
greg


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #4  
Old November 23rd, 2005, 02:22 AM
Josh Close
Guest
 
Posts: n/a
Default Re: postgres start problems with memory

On 30 Sep 2004 16:40:58 -0400, Greg Stark <gsstark@mit.edu> wrote:[color=blue]
>
> Josh Close <narshe@gmail.com> writes:
>[color=green]
> > To reduce the request size (currently 34037760 bytes),[/color]
> ...[color=green]
> > root # sysctl -a | grep shm
> > kernel.shmmni = 4096
> > kernel.shmall = 31584400
> > kernel.shmmax = 31584400[/color]
>
> So it's currently looking for 34M and you're setting the maximum to 31M.
>
> --
> greg[/color]


We'll, you're definitely right about that. Is there a certain standard
to this? Say if I use the "reasonable value" formula. What would be a
good size for the buffer then? Should it be a certain %age of
available RAM?

-Josh

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles