Re: [CentOS] persistent change of max_stack_depth
Hi Gordon, On 17/08/15 19:07, Gordon Messmer wrote: On 08/17/2015 03:34 AM, Michael H wrote: the [Service] section - [Service] LimitSTACK=12288 ... By the errors I will assume that it should be in the [Service] section. I couldn't find confirmation of this online... Yes, it belongs in the [Service] section. $ man systemd.exec ... The execution specific configuration options are configured in the [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type. However, I assume that you are confused because ulimit in a bash shell returns a value in KiB, but LimitSTACK and setrlimit accept a value in bytes. That is, you've decreased the stack size to 12KiB, which is why PostgreSQL segfaults immediately. That is the most valuable piece of information! I couldn't find this documented anywhere, maybe I just looked in the wrong place... # cat /etc/systemd/system/postgresql.service .include /lib/systemd/system/postgresql.service [Service] LimitSTACK=12582912 # grep stack /var/lib/pgsql/data/postgresql.conf max_stack_depth = 10MB# min 100kB # systemctl daemon-reload # systemctl restart postgresql ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos Thank you for your help, Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Hi All, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. What CentOS version? CentOS7.1 Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? If this is CentOS 7 then you may need to put the ulimit directives in the service file. An example is I needed to increase the NOFILE limit for nfs-secure on a Fedora 20 machine so I set LimitNOFILE=16384 In /etc/systemd/system/nfs-secure.service I located the service file for postgresql-9.4 [root@db1 multi-user.target.wants]# locate postgresql-9.4.service /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service /usr/lib/systemd/system/postgresql-9.4.service I've edited /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service and added LimitSTACK=12288 to the [Unit] section of the service file. systemctl daemon-reload systemctl restart postgresql-9.4 I'm still getting the same errors when I try to start my service... Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST DETAIL: max_stack_depth must not exceed 7680kB. I have tried moving the 'LimitSTACK=12288' to other sections of the service file, when I do I don't get my error from postgresql I see this in /var/log/messages Aug 17 08:38:47 db1 systemd: Reloading. Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:49 db1 systemd: Starting PostgreSQL 9.4 database server... Aug 17 08:38:49 db1 kernel: postgresql94-ch[3021]: segfault at 7ffcd1a28f30 ip 7f116054c79e sp 7ffcd1a28f30 error 6 in libc-2.17.so[7f1160458000+1b6000] Aug 17 08:38:49 db1 systemd: postgresql-9.4.service: control process exited, code=killed status=11 Aug 17 08:38:49 db1 systemd: Failed to start PostgreSQL 9.4 database server. Aug 17 08:38:49 db1 systemd: Unit postgresql-9.4.service entered failed state. Hi All, On the PostgreSQL mailing list I've been pointed to this URL; https://ma.ttias.be/increase-open-files-limit-in-mariadb-on-centos-7-with-systemd/ I've created a directory (I tried changing the 9.4 to 9-4 also) /etc/systemd/system/postgresql-9.4.service.d /etc/systemd/system/postgresql-9-4.service.d created a 'limits.conf' file inside this directory containing [Service] LimitSTACK=12288 and I'm unable to restart the service still... I see the same errors as above when I run systemctl status postgresql-9.4 -l. any more suggestions?! I have created a new directory /etc/systemd/system/postgresql-9.4.service.d restorecon -Frv /etc/systemd/system/postgresql-9.4.service.d I created a limits.conf I have tried to add this with no section - LimitSTACK=12288 output: Aug 17 11:18:41 db1 systemd: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 11:18:41 db1 systemd: [/etc/systemd/system/postgresql-9.4.service.d/limits.conf:1] Assignment outside of section. Ignoring. Aug 17 11:18:41 db1 systemd: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' the [Unit] section - [Unit] LimitSTACK=12288 output: Aug 17 11:20:06 db1 systemd: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 11:20:06 db1 systemd:
Re: [CentOS] persistent change of max_stack_depth
On 08/17/2015 03:34 AM, Michael H wrote: the [Service] section - [Service] LimitSTACK=12288 ... By the errors I will assume that it should be in the [Service] section. I couldn't find confirmation of this online... Yes, it belongs in the [Service] section. $ man systemd.exec ... The execution specific configuration options are configured in the [Service], [Socket], [Mount], or [Swap] sections, depending on the unit type. However, I assume that you are confused because ulimit in a bash shell returns a value in KiB, but LimitSTACK and setrlimit accept a value in bytes. That is, you've decreased the stack size to 12KiB, which is why PostgreSQL segfaults immediately. # cat /etc/systemd/system/postgresql.service .include /lib/systemd/system/postgresql.service [Service] LimitSTACK=12582912 # grep stack /var/lib/pgsql/data/postgresql.conf max_stack_depth = 10MB# min 100kB # systemctl daemon-reload # systemctl restart postgresql ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Hi Jason, On 14/08/15 16:45, Jason Warr wrote: On Fri, 2015-08-14 at 16:31 +0100, Michael H wrote: Hi Thomas, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. What CentOS version? CentOS7.1 Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? If this is CentOS 7 then you may need to put the ulimit directives in the service file. An example is I needed to increase the NOFILE limit for nfs-secure on a Fedora 20 machine so I set LimitNOFILE=16384 In /etc/systemd/system/nfs-secure.service I located the service file for postgresql-9.4 [root@db1 multi-user.target.wants]# locate postgresql-9.4.service /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service /usr/lib/systemd/system/postgresql-9.4.service I've edited /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service and added LimitSTACK=12288 to the [Unit] section of the service file. systemctl daemon-reload systemctl restart postgresql-9.4 I'm still getting the same errors when I try to start my service... Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST DETAIL: max_stack_depth must not exceed 7680kB. I have tried moving the 'LimitSTACK=12288' to other sections of the service file, when I do I don't get my error from postgresql I see this in /var/log/messages Aug 17 08:38:47 db1 systemd: Reloading. Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:49 db1 systemd: Starting PostgreSQL 9.4 database server... Aug 17 08:38:49 db1 kernel: postgresql94-ch[3021]: segfault at 7ffcd1a28f30 ip 7f116054c79e sp 7ffcd1a28f30 error 6 in libc-2.17.so[7f1160458000+1b6000] Aug 17 08:38:49 db1 systemd: postgresql-9.4.service: control process exited, code=killed status=11 Aug 17 08:38:49 db1 systemd: Failed to start PostgreSQL 9.4 database server. Aug 17 08:38:49 db1 systemd: Unit postgresql-9.4.service entered failed state. Thanks in advance, Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos Should I, or can I make this change elsewhere? thanks Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Just a quick addition - On 17/08/15 08:40, Michael H wrote: Hi Jason, On 14/08/15 16:45, Jason Warr wrote: On Fri, 2015-08-14 at 16:31 +0100, Michael H wrote: Hi Thomas, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. What CentOS version? CentOS7.1 Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? If this is CentOS 7 then you may need to put the ulimit directives in the service file. An example is I needed to increase the NOFILE limit for nfs-secure on a Fedora 20 machine so I set LimitNOFILE=16384 In /etc/systemd/system/nfs-secure.service I located the service file for postgresql-9.4 [root@db1 multi-user.target.wants]# locate postgresql-9.4.service /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service /usr/lib/systemd/system/postgresql-9.4.service I've edited /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service and added LimitSTACK=12288 to the [Unit] section of the service file. systemctl daemon-reload systemctl restart postgresql-9.4 I'm still getting the same errors when I try to start my service... Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 17 08:23:58 db1 pg_ctl[16839]: 2015-08-17 08:23:58.533 BST DETAIL: max_stack_depth must not exceed 7680kB. I have tried moving the 'LimitSTACK=12288' to other sections of the service file, when I do I don't get my error from postgresql I see this in /var/log/messages Aug 17 08:38:47 db1 systemd: Reloading. Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:47 db1 systemd: [/usr/lib/systemd/system/lvm2-lvmetad.socket:9] Unknown lvalue 'RemoveOnStop' in section 'Socket' Aug 17 08:38:49 db1 systemd: Starting PostgreSQL 9.4 database server... Aug 17 08:38:49 db1 kernel: postgresql94-ch[3021]: segfault at 7ffcd1a28f30 ip 7f116054c79e sp 7ffcd1a28f30 error 6 in libc-2.17.so[7f1160458000+1b6000] Aug 17 08:38:49 db1 systemd: postgresql-9.4.service: control process exited, code=killed status=11 Aug 17 08:38:49 db1 systemd: Failed to start PostgreSQL 9.4 database server. Aug 17 08:38:49 db1 systemd: Unit postgresql-9.4.service entered failed state. Hi All, On the PostgreSQL mailing list I've been pointed to this URL; https://ma.ttias.be/increase-open-files-limit-in-mariadb-on-centos-7-with-systemd/ I've created a directory (I tried changing the 9.4 to 9-4 also) /etc/systemd/system/postgresql-9.4.service.d /etc/systemd/system/postgresql-9-4.service.d created a 'limits.conf' file inside this directory containing [Service] LimitSTACK=12288 and I'm unable to restart the service still... I see the same errors as above when I run systemctl status postgresql-9.4 -l. any more suggestions?! thanks Michael Thanks in advance, Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos Should I, or can I make this change elsewhere? thanks Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Am 15.08.2015 um 23:38 schrieb Thomas Eriksson thomas.eriks...@slac.stanford.edu: On Aug 15, 2015 13:23, Mark Milhollan m...@pixelgate.net wrote: On Fri, 14 Aug 2015, Thomas Eriksson wrote: If it's centos 6 stick 'ulimit -s' in the init script I suggest putting it in the sysconfig file instead, if such exists. Sure, but how many init scripts provide for adding an extra command via sysconfig files? Most of them only allows for adding some predefined options to main service start command. while processing the init script the sysconfig files are sourced and completely parsed as they where part of the init script. So, everything will interpreted. -- LF ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On Aug 16, 2015 11:20, Leon Fauster leonfaus...@googlemail.com wrote: Am 15.08.2015 um 23:38 schrieb Thomas Eriksson thomas.eriks...@slac.stanford.edu: On Aug 15, 2015 13:23, Mark Milhollan m...@pixelgate.net wrote: On Fri, 14 Aug 2015, Thomas Eriksson wrote: If it's centos 6 stick 'ulimit -s' in the init script I suggest putting it in the sysconfig file instead, if such exists. Sure, but how many init scripts provide for adding an extra command via sysconfig files? Most of them only allows for adding some predefined options to main service start command. while processing the init script the sysconfig files are sourced and completely parsed as they where part of the init script. So, everything will interpreted. -- LF Yes, you are absolutely correct, my bad. Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On Aug 15, 2015 13:23, Mark Milhollan m...@pixelgate.net wrote: On Fri, 14 Aug 2015, Thomas Eriksson wrote: If it's centos 6 stick 'ulimit -s' in the init script I suggest putting it in the sysconfig file instead, if such exists. Sure, but how many init scripts provide for adding an extra command via sysconfig files? Most of them only allows for adding some predefined options to main service start command. Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On 08/14/2015 07:19 AM, Michael H wrote: I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. It's already been pointed out that you'll need to modify the init script, but just to make clear why that is the case, I thought it should be pointed out that ulimit is a bash built-in command. When you run ulimit -s 10240 you're not modifying the system, as a whole. You're only modifying that shell's environment and any child process that you start from that shell. Not only does the command not survive a reboot, it doesn't persist between logins. And that's one of the better features of systemd. Because services are always started by systemd, they don't inherit environment, or process limits, or SELinux context from a login shell. If they start correctly interactively, via systemctl, they'll start correctly the next time the system boots. Under the old init system, that wasn't true. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On 8/15/2015 1:17 PM, Gordon Messmer wrote: On 08/14/2015 07:19 AM, Michael H wrote: I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. It's already been pointed out that you'll need to modify the init script, but just to make clear why that is the case, I thought it should be pointed out that ulimit is a bash built-in command. When you run ulimit -s 10240 you're not modifying the system, as a whole. You're only modifying that shell's environment and any child process that you start from that shell. Not only does the command not survive a reboot, it doesn't persist between logins. And that's one of the better features of systemd. Because services are always started by systemd, they don't inherit environment, or process limits, or SELinux context from a login shell. If they start correctly interactively, via systemctl, they'll start correctly the next time the system boots. Under the old init system, that wasn't true. The problem with it though is it ignores system wide and user specific baseline settings. If systemd still obeyed ulimits.conf I would agree that it was an improvement. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On Fri, 14 Aug 2015, Thomas Eriksson wrote: If it's centos 6 stick 'ulimit -s' in the init script I suggest putting it in the sysconfig file instead, if such exists. /mark ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] persistent change of max_stack_depth
Hi All, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. I've Googled plenty and can't find any solution, thanks Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Hi Thomas, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? Thanks in advance, Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On Fri, 2015-08-14 at 16:31 +0100, Michael H wrote: Hi Thomas, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. What CentOS version? Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' - Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? If this is CentOS 7 then you may need to put the ulimit directives in the service file. An example is I needed to increase the NOFILE limit for nfs-secure on a Fedora 20 machine so I set LimitNOFILE=16384 In /etc/systemd/system/nfs-secure.service Thanks in advance, Michael ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
On Aug 14, 2015 08:45, Jason Warr ja...@warr.net wrote: On Fri, 2015-08-14 at 16:31 +0100, Michael H wrote: Hi Thomas, Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. What CentOS version? Look at the file /etc/security/limits.conf For documentation, 'man limits.conf' I added these two lines to the end of the file * soft stack 12288 * hard stack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST LOG: invalid value for parameter max_stack_depth: 10240 Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST DETAIL: max_stack_depth must not exceed 7680kB. Aug 14 16:22:17 db1 pg_ctl[3177]: 2015-08-14 16:22:17.839 BST HINT: Increase the platform's stack depth limit via ulimit -s or local equivalent. So, I then run 'ulimit -s 12288' and still can't restart my service. How can I increase stack depth for system processes, not just PAM authenticated users? If this is CentOS 7 then you may need to put the ulimit directives in the service file. An example is I needed to increase the NOFILE limit for nfs-secure on a Fedora 20 machine so I set LimitNOFILE=16384 In /etc/systemd/system/nfs-secure.service Jason is probably on the right track here. If it's centos 6 stick 'ulimit -s' in the init script If it's centos 7 use LimitSTACK= in the service file -Thomas ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] persistent change of max_stack_depth
Michael H wrote: Could anybody point me in the right direction for setting the kernel parameter, max_stack_depth, to 10240 for database tuning? I have currently set it by running 'ulimit -s 10240' but this does not survive a reboot. Thanks for the response, I've been nosing around that file recently but noted the first two lines; #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. Look at the file /etc/security/limits.conf I added these two lines to the end of the file * softstack 12288 * hardstack 12288 in an attempt to set the stack depth to 12MB so that I can configure postgresql max_stack_depth = 10MB. I rebooted, ulimit -s shows 12288. When I restart my service (#It does not affect resource limits of the system services.) becomes apparent. snip Well, a quick and dirty hack would be to add that as a script in /etc/rd.local (or whatever the appropriate place is for CentOS 7). mark ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos