Re: can't get pg_stat_statements to work - Mailing list pgsql-novice

From richard@xentu.com
Subject Re: can't get pg_stat_statements to work
Date
Msg-id bd004c516d524089535408ba204f131d@xentu.com
Whole thread Raw
In response to Re: can't get pg_stat_statements to work  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
On 2015-09-19 19:57, Tom Lane wrote:
> richard@xentu.com writes:
>> Sorry, I was unclear in my description.
>> In the normal course of events, log files are written in the format
>> /var/lib/postgresql/8.4/main/pg_log/postgresql-2015-09-19_182328.log
>> It's only when the server fails to start, as I described, that no such
>> file is generated.
>
> In that case, the error is happening before the server switches the
> log destination away from its initial stderr.  You need to look at
> the postmaster start script to see where it's sending stderr to
> begin with.  (In Red Hat's scripts there's a fixed file used for such
> early-startup output, but I don't know what Ubuntu does about it.)
>
> Another idea would be to try launching the server by hand, ie just
>
>     postmaster -D /path/to/data/directory
>
> and see what happens.  With no redirection, the desired message should
> just appear on your terminal.
>
>             regards, tom lane


ok, doing that reveals the problem:

2015-09-20 10:18:26 BST   LOG:  loaded library
"/usr/lib/postgresql/8.4/lib/pg_stat_statements.so"
2015-09-20 10:18:26 BST   FATAL:  could not create shared memory
segment: Invalid argument
2015-09-20 10:18:26 BST   DETAIL:  Failed system call was
shmget(key=5432001, size=33710080, 03600).
2015-09-20 10:18:26 BST   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
33710080 bytes), reduce PostgreSQL's shared_buffers parameter (currently
3584) and/or its max_connections parameter (currently 103).
         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.


In postgresql.conf I've changed shared_buffers from 28MB to 16MB & the
server will now start. I'm running postgresql on a host I'm renting with
limited resources.


Thanks to Tom & David for your help.

Richard



pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: can't get pg_stat_statements to work
Next
From: abdujaparov
Date:
Subject: Script and tool to monitoring sessions