{"id":84,"date":"2013-06-06T10:12:34","date_gmt":"2013-06-06T10:12:34","guid":{"rendered":"http:\/\/blogs.kent.ac.uk\/unseenit\/?p=84"},"modified":"2013-06-06T10:12:34","modified_gmt":"2013-06-06T10:12:34","slug":"changing-ulimit-for-running-processes","status":"publish","type":"post","link":"https:\/\/blogs.kent.ac.uk\/unseenit\/changing-ulimit-for-running-processes\/","title":{"rendered":"Changing ulimit for running processes"},"content":{"rendered":"<p>I&#8217;ve been trying to work out how to alter the coredump limits for a running processes (well, batch of processes, really) without needing GDB and it was turning out to be quite hard.<\/p>\n<p>Further searching turned up an article on <a href=\"http:\/\/serverfault.com\/questions\/201207\/set-max-file-limit-on-a-running-process\">serverfault<\/a>\u00a0saying:<\/p>\n<blockquote><p>On newer kernels (2.6.32+) you can change this at runtime with \/proc\/\/limits:<\/p>\n<pre><code>cd \/proc\/7671\/\r\n[root@host 7671]# cat limits  | grep nice\r\nMax nice priority         0                    0                    \r\n[root@host 7671]# echo -n \"Max nice priority=5:6\" &gt; limits\r\n[root@host 7671]# cat limits  | grep nice\r\nMax nice priority         5                    6        <\/code><\/pre>\n<\/blockquote>\n<p>Trying this out on our local RHEL 6.2 (running 2.6.32-358.6.2.el6.x86_64)\u00a0infrastructure to set unlimited on all Apache (httpd) processes works magic:<\/p>\n<pre><code>\r\n# for pid in `pgrep httpd` ; do grep core \/proc\/$pid\/limits ; done | head \r\nMax core file size        0                    unlimited            bytes\r\nMax core file size        0                    unlimited            bytes\r\nMax core file size        0                    unlimited            bytes\r\nMax core file size        0                    unlimited            bytes\r\nMax core file size        0                    unlimited            bytes\r\n\r\n# for pid in `pgrep httpd` ; do echo -n \"Max core file size=unlimited:unlimited\" &gt;\/proc\/$pid\/limits ; done\r\n\r\n# for pid in `pgrep httpd` ; do grep core \/proc\/$pid\/limits ; done | head\r\nMax core file size        unlimited            unlimited            bytes\r\nMax core file size        unlimited            unlimited            bytes\r\nMax core file size        unlimited            unlimited            bytes\r\nMax core file size        unlimited            unlimited            bytes\r\nMax core file size        unlimited            unlimited            bytes\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been trying to work out how to alter the coredump limits for a running processes (well, batch of processes, really) without needing GDB and &hellip; <a href=\"https:\/\/blogs.kent.ac.uk\/unseenit\/changing-ulimit-for-running-processes\/\">Read&nbsp;more<\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[28934,28935],"_links":{"self":[{"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/posts\/84"}],"collection":[{"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":4,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/posts\/84\/revisions\/88"}],"wp:attachment":[{"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/unseenit\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}