Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id F316E9FA21A for ; Thu, 25 Jan 2007 16:39:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 68782-07 for ; Thu, 25 Jan 2007 16:39:18 -0400 (AST) X-Greylist: delayed 00:27:50.350162 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 5A7C49FB66F for ; Thu, 25 Jan 2007 16:39:26 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.mxpath.net (unknown [207.7.111.53]) by svr4.postgresql.org (Postfix) with ESMTP id 2A9BE5AFAD1 for ; Thu, 25 Jan 2007 20:11:35 +0000 (GMT) Received: from enterprise.filter (san-mail-ef5.mxpath.net [172.16.10.75]) by san-mail-out3.mxpath.net (MXPath Final Delivery) with SMTP id A3FA34BCD16; Thu, 25 Jan 2007 20:11:32 +0000 (GMT) Received: from san-mail-fr7.mxpath.net (san-mail-sc2.mxpath.net [172.16.10.91]) by san-mail-ef5.mxpath.net (MXPath Enterprise Filter) with ESMTP id 36C304C458A; Thu, 25 Jan 2007 20:11:32 +0000 (GMT) Received: from mail.stbernard.com (mail.stbernard.com [64.154.93.162]) by san-mail-fr7.mxpath.net (MXPath Enterprise2) with ESMTP id 38AD11E064D; Thu, 25 Jan 2007 20:11:32 +0000 (GMT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: shared_buffers and shmall,shmmax Date: Thu, 25 Jan 2007 12:11:32 -0800 Message-ID: <00C5463E8A5F7C41A8396D701A6734B101C07CDB@mail01.stbernard.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: shared_buffers and shmall,shmmax Thread-Index: AcdAuZcwElHRqbEIRj2kfKAw2ARS5wAAemEQ From: "Jie Liang" To: "Tom Lane" Cc: X-ThreatScan3: CLEAN X-ThreatScan2-REF: str=0001.0A090205.45B90EF3.00D9,ss=1,fgs=0 X-ThreatScan2: CLEAN X-OrigIP: 64.154.93.162 OK X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/124 X-Sequence-Number: 27276 Tom, I am trying to tunrn my db server (p4 3.2GHzCPU, 2GB RAM on FreeBSD 5.5, postgresql 8.1.4), I am trying to increase the share_buffer to 512M 1/4 of RAM, so I set it to shared_buffers=3D65536 (512M), then failed to start, then I reduce to 60000,40000,30000, it failed to start database until 20000. Following is my kernel: kern.ipc.maxsockbuf: 262144 kern.ipc.sockbuf_waste_factor: 8 kern.ipc.somaxconn: 128 kern.ipc.semaem: 16384 kern.ipc.semvmx: 32767 kern.ipc.semusz: 344 kern.ipc.semume: 40 kern.ipc.semopm: 100 kern.ipc.semmsl: 240 kern.ipc.semmnu: 120 kern.ipc.semmns: 240 kern.ipc.semmni: 40 kern.ipc.semmap: 30 kern.ipc.shm_allow_removed: 0 kern.ipc.shm_use_phys: 0 kern.ipc.shmall: 65536 kern.ipc.shmseg: 128 kern.ipc.shmmni: 192 kern.ipc.shmmin: 1 kern.ipc.shmmax: 536870912 kern.ipc.numopensockets: 117 kern.ipc.maxsockets: 25600 shmmax is 512M shmall is 65536 page following is my pgsql.log: Jan 25 09:52:09 iguard postgres[49577]: [7-1] FATAL: terminating connection due to administrator command Jan 25 09:52:09 iguard postgres[46784]: [15-1] FATAL: terminating connection due to administrator command Jan 25 09:52:09 iguard postgres[49439]: [12-1] FATAL: terminating connection due to administrator command Jan 25 09:54:00 iguard postgres[49909]: [1-3] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. Jan 25 09:54:00 iguard postgres[49909]: [1-4] You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently Jan 25 09:54:00 iguard postgres[49909]: [1-5] 607731712 bytes), reduce PostgreSQL's shared_buffers parameter (currently 65535) and/or its max_connections parameter Jan 25 09:54:00 iguard postgres[49909]: [1-6] (currently 120). Jan 25 09:54:00 iguard postgres[49909]: [1-7] If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising Jan 25 09:54:00 iguard postgres[49909]: [1-8] the request size or reconfiguring SHMMIN is called for. Jan 25 09:54:00 iguard postgres[49909]: [1-9] The PostgreSQL documentation contains more information about shared memory configuration. Jan 25 09:54:31 iguard postgres[49919]: [1-1] FATAL: could not create shared memory segment: Invalid argument Jan 25 09:54:31 iguard postgres[49919]: [1-2] DETAIL: Failed system call was shmget(key=3D5432001, size=3D561455104, 03600). Jan 25 09:54:31 iguard postgres[49919]: [1-3] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. Jan 25 09:54:31 iguard postgres[49919]: [1-4] You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently Jan 25 09:54:31 iguard postgres[49919]: [1-5] 561455104 bytes), reduce PostgreSQL's shared_buffers parameter (currently 60000) and/or its max_connections parameter Jan 25 09:54:31 iguard postgres[49919]: [1-6] (currently 120). Jan 25 09:54:31 iguard postgres[49919]: [1-7] If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising Jan 25 09:54:31 iguard postgres[49919]: [1-8] the request size or reconfiguring SHMMIN is called for. Jan 25 09:54:31 iguard postgres[49919]: [1-9] The PostgreSQL documentation contains more information about shared memory configuration. Jan 25 09:55:00 iguard postgres[49929]: [1-1] FATAL: could not create shared memory segment: Cannot allocate memory Jan 25 09:55:00 iguard postgres[49929]: [1-2] DETAIL: Failed system call was shmget(key=3D5432001, size=3D394256384, 03600). Jan 25 09:55:00 iguard postgres[49929]: [1-3] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. Jan 25 09:55:00 iguard postgres[49929]: [1-4] To reduce the request size (currently 394256384 bytes), reduce PostgreSQL's shared_buffers parameter (currently 40000) and/or Jan 25 09:55:00 iguard postgres[49929]: [1-5] its max_connections parameter (currently 120). Jan 25 09:55:00 iguard postgres[49929]: [1-6] The PostgreSQL documentation contains more information about shared memory configuration. Jan 25 09:55:34 iguard postgres[49953]: [1-1] FATAL: could not create shared memory segment: Cannot allocate memory Jan 25 09:55:34 iguard postgres[49953]: [1-2] DETAIL: Failed system call was shmget(key=3D5432001, size=3D310394880, 03600). Jan 25 09:55:34 iguard postgres[49953]: [1-3] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. Jan 25 09:55:34 iguard postgres[49953]: [1-4] To reduce the request size (currently 310394880 bytes), reduce PostgreSQL's shared_buffers parameter (currently 30000) and/or Jan 25 09:55:34 iguard postgres[49953]: [1-5] its max_connections parameter (currently 120). Jan 25 09:55:34 iguard postgres[49953]: [1-6] The PostgreSQL documentation contains more information about shared memory configuration. Jan 25 09:56:17 iguard postgres[49970]: [1-1] LOG: database system was shut down at 2007-01-25 09:52:09 PST Jan 25 09:56:17 iguard postgres[49970]: [2-1] LOG: checkpoint record is at 14B/649807D0 Jan 25 09:56:17 iguard postgres[49970]: [3-1] LOG: redo record is at 14B/649807D0; undo record is at 0/0; shutdown TRUE Jan 25 09:56:17 iguard postgres[49970]: [4-1] LOG: next transaction ID: 4566517; next OID: 361483975 Jan 25 09:56:17 iguard postgres[49970]: [5-1] LOG: next MultiXactId: 1; next MultiXactOffset: 0 Jan 25 09:56:17 iguard postgres[49970]: [6-1] LOG: database system is ready Jan 25 09:56:17 iguard postgres[49970]: [7-1] LOG: transaction ID wrap limit is 1077475224, limited by database "urldbdev" Jan 25 09:57:00 iguard postgres[49988]: [1-1] LOG: statement: SELECT count(*) FROM public.unchecked WHERE allocatedto IS NULL OR allocatedto =3D 'EX' Jan 25 09:57:12 iguard postgres[49969]: [1-1] LOG: received fast shutdown request Jan 25 09:57:12 iguard postgres[49971]: [1-1] LOG: shutting down Jan 25 09:57:12 iguard postgres[49971]: [2-1] LOG: database system is shut down Jan 25 09:57:13 iguard postgres[49997]: [1-1] FATAL: could not create shared memory segment: Cannot allocate memory Jan 25 09:57:13 iguard postgres[49997]: [1-2] DETAIL: Failed system call was shmget(key=3D5432001, size=3D310394880, 03600). Jan 25 09:57:13 iguard postgres[49997]: [1-3] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. Jan 25 09:57:13 iguard postgres[49997]: [1-4] To reduce the request size (currently 310394880 bytes), reduce PostgreSQL's shared_buffers parameter (currently 30000) and/or Jan 25 09:57:13 iguard postgres[49997]: [1-5] its max_connections parameter (currently 120). Jan 25 09:57:13 iguard postgres[49997]: [1-6] The PostgreSQL documentation contains more information about shared memory configuration. Jan 25 09:58:20 iguard postgres[50012]: [1-1] LOG: database system was shut down at 2007-01-25 09:57:12 PST Jan 25 09:58:20 iguard postgres[50012]: [2-1] LOG: checkpoint record is at 14B/64980820 Jan 25 09:58:20 iguard postgres[50012]: [3-1] LOG: redo record is at 14B/64980820; undo record is at 0/0; shutdown TRUE Jan 25 09:58:20 iguard postgres[50012]: [4-1] LOG: next transaction ID: 4566519; next OID: 361483975 Jan 25 09:58:20 iguard postgres[50012]: [5-1] LOG: next MultiXactId: 1; next MultiXactOffset: 0 Jan 25 09:58:20 iguard postgres[50012]: [6-1] LOG: database system is ready Question: How come that shared_buffers=3D40000 (or 30000), which request size 394256384 (or 310394880) bytes is much lower then shmmax(536870912 bytes), and max_connection is set to 125 still failed to start postmaster? Thanks, Best regards, Jie Liang