[ADMIN] Postgres shared memory error
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
Re: [ADMIN] Postgres shared memory error
On Sat, Apr 28, 2012 at 13:10, Kevin Kempter wrote: > 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? > > What does the 'free' command show? > 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? > 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? > > You haven't provided evidence on how much RAM your system sees. A free -m will show the total memory the system has and is being used. Regards.
Re: [ADMIN] Postgres shared memory error
On 04/28/2012 10:32 AM, Fernando Hevia wrote: On Sat, Apr 28, 2012 at 13:10, Kevin Kempter mailto:cs_...@consistentstate.com>> wrote: 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? What does the 'free' command show? 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? 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? You haven't provided evidence on how much RAM your system sees. A free -m will show the total memory the system has and is being used. Regards. Free command: / # free total used free sharedbuffers cached Mem: 1020856 946804 74052 0 61280 796004 -/+ buffers/cache: 89520 931336 Swap:0 0 0/
Re: [ADMIN] Configuring pg on os x lion
Hi, Sure, here are the results from the two commands: larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_config BINDIR = /usr/local/Cellar/postgresql/9.1.3/bin DOCDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql HTMLDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql INCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include PKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include INCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.1.3/include/server LIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib PKGLIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib LOCALEDIR = /usr/local/Cellar/postgresql/9.1.3/share/locale MANDIR = /usr/local/Cellar/postgresql/9.1.3/share/man SHAREDIR = /usr/local/Cellar/postgresql/9.1.3/share/postgresql SYSCONFDIR = /usr/local/Cellar/postgresql/9.1.3/etc PGXS = /usr/local/Cellar/postgresql/9.1.3/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.1.3' '--datadir=/usr/local/Cellar/postgresql/9.1.3/share/postgresql' '--docdir=/usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-krb5' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-python' '--with-perl' 'ARCHFLAGS='''-arch x86_64 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include' 'LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib' 'LIBS=-luuid' 'CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2' CC = /usr/bin/llvm-gcc CPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2 -I/usr/local/include/libxml2 CFLAGS = -Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv CFLAGS_SL = LDFLAGS = -L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib -L/usr/local/lib -Wl,-dead_strip_dylibs LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm -luuid VERSION = PostgreSQL 9.1.3 larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D /user/local/var/postgres status pg_ctl: no server running Even though the result above is "no server running", I am do have a postgres server running. larson:~ larson$ ps -a | grep postgres 17476 ttys001 0:00.12 postgres -D /usr/local/var/postgres 17543 ttys002 0:00.00 grep postgres On a final note when I try to run psql I get the following result: larson:~ larson$ psql psql: FATAL: database "larson" does not exist Thanks, Andrew On Apr 27, 2012, at 09:51 PM, raghu ram wrote: On Sat, Apr 28, 2012 at 12:52 AM, Andrew Barinov wrote: Hi Everyone, I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before. I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? So I go ahead and try to run postgres directly. When I do I get this: larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them? Thanks in advance for your help, Andrew Could you please share below information for troubleshooting this issue: /usr/local/Cellar/postgresql/9.1.3/bin/pg_config /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D status -- Thanks & Regards, Raghu Ram EnterpriseDB: http://www.enterprisedb.com
Re: [ADMIN] Configuring pg on os x lion
Hi, I'd just like to say that I resolved my issue. Thanks! Andrew On Apr 28, 2012, at 12:58 PM, Andrew Barinov wrote: Hi, Sure, here are the results from the two commands: larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_config BINDIR = /usr/local/Cellar/postgresql/9.1.3/bin DOCDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql HTMLDIR = /usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql INCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include PKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.1.3/include INCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.1.3/include/server LIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib PKGLIBDIR = /usr/local/Cellar/postgresql/9.1.3/lib LOCALEDIR = /usr/local/Cellar/postgresql/9.1.3/share/locale MANDIR = /usr/local/Cellar/postgresql/9.1.3/share/man SHAREDIR = /usr/local/Cellar/postgresql/9.1.3/share/postgresql SYSCONFDIR = /usr/local/Cellar/postgresql/9.1.3/etc PGXS = /usr/local/Cellar/postgresql/9.1.3/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.1.3' '--datadir=/usr/local/Cellar/postgresql/9.1.3/share/postgresql' '--docdir=/usr/local/Cellar/postgresql/9.1.3/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-krb5' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-ossp-uuid' '--with-python' '--with-perl' 'ARCHFLAGS='''-arch x86_64 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include' 'LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib' 'LIBS=-luuid' 'CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2' CC = /usr/bin/llvm-gcc CPPFLAGS = -I/usr/local/Cellar/readline/6.2.2/include -I/usr/include/libxml2 -I/usr/local/include/libxml2 CFLAGS = -Os -w -pipe -march=core2 -msse4 -I/usr/local/Cellar/ossp-uuid/1.6.2/include -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv CFLAGS_SL = LDFLAGS = -L/usr/local/Cellar/readline/6.2.2/lib -L/usr/local/Cellar/ossp-uuid/1.6.2/lib -L/usr/local/lib -Wl,-dead_strip_dylibs LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm -luuid VERSION = PostgreSQL 9.1.3 larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D /user/local/var/postgres status pg_ctl: no server running Even though the result above is "no server running", I am do have a postgres server running. larson:~ larson$ ps -a | grep postgres 17476 ttys001 0:00.12 postgres -D /usr/local/var/postgres 17543 ttys002 0:00.00 grep postgres On a final note when I try to run psql I get the following result: larson:~ larson$ psql psql: FATAL: database "larson" does not exist Thanks, Andrew On Apr 27, 2012, at 09:51 PM, raghu ram wrote: On Sat, Apr 28, 2012 at 12:52 AM, Andrew Barinov wrote: Hi Everyone, I am trying to get pg working on os x lion and getting some configuration errors. Wondering if anyone on this list faced these before. I installed pg via homebrew and I get this error when trying to launch it via a local web server on my machine: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? So I go ahead and try to run postgres directly. When I do I get this: larson:~ larson$ /usr/local/Cellar/postgresql/9.1.3/bin/postgres ; exit; postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable. logout So my thinking here is that the config files are missing. I searched for pg_hba.conf file and couldn't find it. Now I am unsure how to proceed, when I used pg on os x Snow Leopard I could go into a ~/Library/Developer/postgresql folder and all my config files would be there. There would also be logs I could read to get a better idea of what's going. Now those seem to be missing, does anyone know where I can find them? Thanks in advance for your help, Andrew Could you please share below information for troubleshooting this issue: /usr/local/Cellar/postgresql/9.1.3/bin/pg_config /usr/local/Cellar/postgresql/9.1.3/bin/pg_ctl -D status -- Thanks & Regards, Raghu Ram EnterpriseDB: http://www.enterprisedb.com
Re: [ADMIN] Postgres shared memory error
On Sat, Apr 28, 2012 at 13:37, Kevin Kempter wrote: > > Free command: > > * # free > total used free sharedbuffers cached > Mem: 1020856 946804 74052 0 61280 796004 > -/+ buffers/cache: 89520 931336 > Swap:0 0 0* > > > You are right. Your system has only 1 GB RAM.