Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id A74B0358049 for ; Sat, 28 Apr 2012 13:10:18 -0300 (ADT) Received: from 74-93-229-125-colorado.hfc.comcastbusiness.net ([74.93.229.125] helo=mail.consistentstate.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SOADw-0001Rj-Qf for pgsql-admin@postgresql.org; Sat, 28 Apr 2012 16:10:18 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.consistentstate.com (Postfix) with ESMTP id E995F3063CC for ; Sat, 28 Apr 2012 10:10:02 -0600 (MDT) X-Virus-Scanned: amavisd-new at consistentstate.com Received: from mail.consistentstate.com ([127.0.0.1]) by localhost (mail.consistentstate.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GPJzztrmIGIw for ; Sat, 28 Apr 2012 10:10:02 -0600 (MDT) Received: from Issac.consistentstate.com (unknown [67.137.237.194]) by mail.consistentstate.com (Postfix) with ESMTPSA id 00240303BBD for ; Sat, 28 Apr 2012 10:10:01 -0600 (MDT) Message-ID: <4F9C1659.5070503@consistentstate.com> Date: Sat, 28 Apr 2012 10:10:01 -0600 From: Kevin Kempter User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Postgres shared memory error Content-Type: multipart/alternative; boundary="------------090102040801060100000808" X-Pg-Spam-Score: -0.9 (/) X-Archive-Number: 201204/147 X-Sequence-Number: 39483 This is a multi-part message in MIME format. --------------090102040801060100000808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit All; I just want to be sure that I'm not causing myself greif. I have a kvm in the cloud that is supposed to have access to 32GB of ram. when I do a top I only see 1GB of ram, I've pinged the hosting provider, maybe it shows up as it's used? Anyway when I try and start postgres I see this: / $ 2012-04-28 12:00:33 EDT [6429]: [1-1] FATAL: XX000: could not create shared memory segment: Cannot allocate memory 2012-04-28 12:00:33 EDT [6429]: [2-1] DETAIL: Failed system call was shmget(key=5432001, size=7700914176, 03600). 2012-04-28 12:00:33 EDT [6429]: [3-1] HINT: 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 7700914176 bytes), reduce PostgreSQL's shared_buffers parameter (currently 917504) and/or its max_connections parameter (currently 503). The PostgreSQL documentation contains more information about shared memory configuration. 2012-04-28 12:00:33 EDT [6429]: [4-1] LOCATION: InternalIpcMemoryCreate, pg_shmem.c:178 / Which means I should bump up shmmax like this: /# sysctl -w kernel.shmmax=7700914176/ and add it to /etc/sysctl.conf: /# tail /etc/sysctl.conf kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296 #PostgreSQL kernel.shmmax = 7700914176 / I assume I should have to tweak ONLY kernel.shmmax, am I correct? I'm also assuming that this is a KVM cloud host provider issue, i.e. it looks like I actually do not have 32G or ram. Does anyone disagree with my conclusions? Thanks in advance --------------090102040801060100000808 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit All;

I just want to be sure that I'm not causing myself greif.  I have a kvm in the cloud that is supposed to have access to 32GB of ram. when I do a top I only see 1GB of ram, I've pinged the hosting provider, maybe it shows up as it's used?

Anyway when I try and start postgres I see this:

 $ 2012-04-28 12:00:33 EDT [6429]: [1-1] FATAL:  XX000: could not create shared memory segment: Cannot allocate memory                    
2012-04-28 12:00:33 EDT [6429]: [2-1] DETAIL:  Failed system call was shmget(key=5432001, size=7700914176, 03600).                                             
2012-04-28 12:00:33 EDT [6429]: [3-1] HINT:  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 7700914176 bytes), reduce PostgreSQL's shared_buffers parameter (currently 917504) and/or its max_connections parameter (currently 503).                                                            
        The PostgreSQL documentation contains more information about shared memory configuration.                                                              
2012-04-28 12:00:33 EDT [6429]: [4-1] LOCATION:  InternalIpcMemoryCreate, pg_shmem.c:178 



Which means I should bump up shmmax like this:

# sysctl -w kernel.shmmax=7700914176


and add it to /etc/sysctl.conf:

# tail /etc/sysctl.conf                                                          
kernel.msgmax = 65536                                                                              
                                                                                                   
# Controls the maximum shared segment size, in bytes                                               
kernel.shmmax = 68719476736                                                                        
                                                                                                   
# Controls the maximum number of shared memory segments, in pages                                  
kernel.shmall = 4294967296                                                                         
                                                                                                   
#PostgreSQL                                                                                        
kernel.shmmax = 7700914176 



I assume I should have to tweak ONLY kernel.shmmax, am I correct?
I'm also assuming that this is a KVM cloud host provider issue, i.e. it looks like I actually do not have 32G or ram.  Does anyone disagree with my conclusions?

Thanks in advance



--------------090102040801060100000808--