Re: stack depth - Mailing list pgsql-general

From Michael H
Subject Re: stack depth
Date
Msg-id 55D1917D.6010002@wemoto.com
Whole thread Raw
In response to Re: stack depth  (Chris Mair <chris@1006.org>)
Responses Re: stack depth
List pgsql-general
Hi Chris,

On 14/08/15 17:19, Chris Mair wrote:
>> Hi All,
>>
>> I'm tuning up my database and need to increase the max_stack_depth
>> parameter in postgresql.conf.
>>
>> I've edited the /etc/security/limits.conf and added
>> *               soft    stack   12288
>> *               hard    stack   12288
>>
>> but I noticed the comments at the top of the file -
>> #This file sets the resource limits for the users logged in via PAM.
>> #It does not affect resource limits of the system services.
>>
>> After saving my changes and rebooting postgresql will not start, I know
>> that the configuration change I have made will only affect users
>> authenticated by PAM but I need to amend the stack depth for ALL system
>> processes.
>>
>> Can anybody point me in the right direction?
>>
>> I'm also asking on the CentOS mailing list but have been pointed to the
>> file above which is not the setting I require.
>>
>> while logged in I can run ulimit -s 12288 but this only affects the
>> current shell.
>
> Hi,
>
> on a CentOS 6.7 box I can confirm that adding those lines to
> /etc/security/limits.conf DOES increase the limit to 12288
> (after a reboot).
>
> I don't see the PAM line, though. What version of CentOS are
> you using?
I'm using CentOS7.1, here's the heading from my /etc/security/limit.conf

# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.####
#########It does not affect resource limits of the system services.#####
#

#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.


The ulimit -s command shows 12288 but upon starting postgresql-9.4 I get
a failure -

Aug 14 16:41:02 db1 pg_ctl[1691]: < 2015-08-14 16:41:02.899 BST >LOG:
invalid value for parameter "max_stack_depth": 10240
Aug 14 16:41:02 db1 pg_ctl[1691]: < 2015-08-14 16:41:02.899 BST >DETAIL:
"max_stack_depth" must not exceed 7680kB.
Aug 14 16:41:02 db1 pg_ctl[1691]: < 2015-08-14 16:41:02.899 BST >HINT:
Increase the platform's stack depth limit via "ulimit -s" or local
equivalent.
Aug 14 16:41:02 db1 pg_ctl[1691]: 2015-08-14 16:41:02 BST [1715]: [4-1]
db=,user= FATAL: F0000: configuration file
"/var/lib/pgsql/9.4/data/postgresql.conf" contains errors

I noted the top two comment lines in limits.conf and figured there is
another location to update system services stack depth?

#This file sets the resource limits for the users logged in via PAM.
postgres will not be 'logged in' via PAM.

#It does not affect resource limits of the system services.
well what does!??

Thanks

Michael
>
> Bye,
> Chris.
>
>
>
>
>
>
>
>
>
>


pgsql-general by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Extension to rewrite queries before execution
Next
From: Chris Mair
Date:
Subject: Re: stack depth