<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.open-xchange.com/wiki/index.php?action=history&amp;feed=atom&amp;title=AppSuite%3AResourceLimits%2Fsandbox</id>
	<title>AppSuite:ResourceLimits/sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.open-xchange.com/wiki/index.php?action=history&amp;feed=atom&amp;title=AppSuite%3AResourceLimits%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;action=history"/>
	<updated>2026-08-17T07:20:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;diff=22808&amp;oldid=prev</id>
		<title>Marens at 18:05, 13 January 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;diff=22808&amp;oldid=prev"/>
		<updated>2017-01-13T18:05:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;amp;diff=22808&amp;amp;oldid=22803&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Marens</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;diff=22803&amp;oldid=prev</id>
		<title>Marens: Created page with &quot; == Configuration of Resource Limits ==  === Overview ===  Several ways exist to restrict resources on a linux system from a global level down to user/groups or even shells an...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:ResourceLimits/sandbox&amp;diff=22803&amp;oldid=prev"/>
		<updated>2017-01-10T17:39:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Configuration of Resource Limits ==  === Overview ===  Several ways exist to restrict resources on a linux system from a global level down to user/groups or even shells an...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Configuration of Resource Limits ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
Several ways exist to restrict resources on a linux system from a global level down to user/groups or even shells and the processes started by them.&lt;br /&gt;
&lt;br /&gt;
==== Sysctl ====&lt;br /&gt;
Sysctl is used to modify kernel parameters at runtime. E.g. to set the maximum number of files&lt;br /&gt;
&lt;br /&gt;
  $ sysctl -w fs.file-max=100000&lt;br /&gt;
&lt;br /&gt;
To permanently set them append to the main configuration file and reload the settings&lt;br /&gt;
&lt;br /&gt;
  $ echo fs.file-max=100000 &amp;gt;&amp;gt; /etc/sysctl.conf&lt;br /&gt;
  $ sysctl -p&lt;br /&gt;
&lt;br /&gt;
More infos can be found via &amp;#039;&amp;#039;&amp;#039;man sysctl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Limits.conf ====&lt;br /&gt;
&lt;br /&gt;
Allows to restrict resources an a global, group or user level. E.g:&lt;br /&gt;
&lt;br /&gt;
   $ cat /etc/security/limits.d/90-nproc.conf &lt;br /&gt;
   # Default limit for number of user&amp;#039;s processes to prevent&lt;br /&gt;
   # accidental fork bombs.&lt;br /&gt;
   # See rhbz #432903 for reasoning.&lt;br /&gt;
   &lt;br /&gt;
   *          soft    nproc     1024&lt;br /&gt;
&lt;br /&gt;
From &amp;#039;&amp;#039;&amp;#039;man limits.conf&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;Also, please note that all limit settings are set per login. They are not global, nor are they permanent; existing only for the duration of the session.&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The limits per login are applied via the &amp;#039;&amp;#039;pam&amp;#039;&amp;#039; stack. See &amp;#039;&amp;#039;&amp;#039;man pam&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;man pam_limits&amp;#039;&amp;#039;&amp;#039; for more details. As those limits are bound to sessions they don&amp;#039;t affect most daemons started by our supported init systems or init utils. Most state that they are ignored by design, see [https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/938669/comments/4 upstart], [https://bugzilla.redhat.com/show_bug.cgi?id=754285#c1 systemd] and [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=302079 start-stop-daemon] &lt;br /&gt;
&lt;br /&gt;
==== Ulimit ====&lt;br /&gt;
From &amp;#039;&amp;#039;&amp;#039;man bash&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
ulimit [-HSTabcdefilmnpqrstuvx [limit]]&lt;br /&gt;
              Provides  control over the resources available to the shell and to processes started by it, on systems that allow such control.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
This is what we use in our System V compatible init scripts to increase resources for the open-xchange process across multiple distros. Currently only &amp;#039;&amp;#039;the maximum number of processes&amp;#039;&amp;#039; and &amp;#039;&amp;#039;the maximum number of open file descriptors available to a single user&amp;#039;&amp;#039; are increased via ulimit. The values are specified in &amp;#039;&amp;#039;&amp;#039;/opt/open-xchange/ox-scriptconf.sh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Open-Xchange middleware on specific distros ==&lt;br /&gt;
The support for the mentioned mechanism of resource control differ depending on the distribution and the init system in use.&lt;br /&gt;
&lt;br /&gt;
=== Debian 7 ===&lt;br /&gt;
;Init&lt;br /&gt;
: System V style&lt;br /&gt;
;OX Configurable Limits/Defaults&lt;br /&gt;
: nofile, nproc&lt;br /&gt;
&lt;br /&gt;
The mentioned limits can be configured via &amp;#039;&amp;#039;&amp;#039;/opt/open-xchange/etc/ox-scriptconf.sh&amp;#039;&amp;#039;&amp;#039;. The limits are applied via ulimit in the service&amp;#039;s init script. The open-xchange service is finally started via start-stop-daemon which doesn&amp;#039;t doesn&amp;#039;t consider &amp;#039;&amp;#039;&amp;#039;/etc/security/limits.*&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== RHEL 6 / CentOS 6 ===&lt;br /&gt;
;Init&lt;br /&gt;
: Upstart, System V compatible&lt;br /&gt;
;OX Configurable Limits/Defaults&lt;br /&gt;
: nofile, nproc&lt;br /&gt;
&lt;br /&gt;
The mentioned limits can be configured via &amp;#039;&amp;#039;&amp;#039;/opt/open-xchange/etc/ox-scriptconf.sh&amp;#039;&amp;#039;&amp;#039;. The limits are applied via ulimit in the service&amp;#039;s init script. Furthermore as the open-xchange service is finally started via &amp;#039;&amp;#039;&amp;#039;su ... open-xchange&amp;#039;&amp;#039;&amp;#039; on this distro a user session is opened via su/pam and the default CentOS pam config reads the &amp;#039;&amp;#039;&amp;#039;/etc/security/limits.*&amp;#039;&amp;#039;&amp;#039; configuration by loading the pam stack like:&lt;br /&gt;
&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;/etc/pam.d/su&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:: &amp;#039;&amp;#039;&amp;#039;-&amp;gt; /etc/pam.d/system-auth&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
::: &amp;#039;&amp;#039;&amp;#039;-&amp;gt; pam_limits.so&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If NPROC isn&amp;#039;t configured for the open-xchange-server it&amp;#039;s restricted to &amp;#039;&amp;#039;&amp;#039;1024&amp;#039;&amp;#039;&amp;#039; globally by default to prevent accidental fork bombs, see &amp;#039;&amp;#039;&amp;#039;/etc/security/limits.d/90-nproc.conf&amp;#039;&amp;#039;&amp;#039; which can result in severe problems modern multithreaded applications.&lt;br /&gt;
&lt;br /&gt;
=== RHEL 7 / CentOS 7 / Debian 8 / SLE 12 ===&lt;br /&gt;
;Init&lt;br /&gt;
: Systemd&lt;br /&gt;
;OX Configurable Limits/Defaults&lt;br /&gt;
: nofile, nproc&lt;br /&gt;
&lt;br /&gt;
For systemd the default limits are configured directly in the service&amp;#039;s unit file that is shipped by OX and located at &amp;#039;&amp;#039;&amp;#039;/usr/lib/systemd/system/open-xchange.service&amp;#039;&amp;#039;&amp;#039;. The drop-in config to override or extend the default unit file is located at &amp;#039;&amp;#039;&amp;#039;/etc/systemd/system/open-xchange.service.d/limits.conf&amp;#039;&amp;#039;&amp;#039;. [https://www.freedesktop.org/software/systemd/man/systemd.exec.html Systemd.exec] shows a whole lot of options that can be used by admins to adapt the default service to their specific needs.&lt;br /&gt;
&lt;br /&gt;
== Verify limits ==&lt;br /&gt;
&lt;br /&gt;
=== System V ===&lt;br /&gt;
  $ read pid &amp;lt; /var/run/open-xchange.pid&lt;br /&gt;
  $ cat /proc/$pid/limits&lt;br /&gt;
  Limit                     Soft Limit           Hard Limit           Units&lt;br /&gt;
  Max cpu time              unlimited            unlimited            seconds&lt;br /&gt;
  Max file size             unlimited            unlimited            bytes&lt;br /&gt;
  Max data size             unlimited            unlimited            bytes&lt;br /&gt;
  Max stack size            8388608              unlimited            bytes&lt;br /&gt;
  Max core file size        0                    unlimited            bytes&lt;br /&gt;
  Max resident set          unlimited            unlimited            bytes&lt;br /&gt;
  Max processes             65536                65536                processes&lt;br /&gt;
  Max open files            65536                65536                files&lt;br /&gt;
  Max locked memory         65536                65536                bytes&lt;br /&gt;
  Max address space         unlimited            unlimited            bytes&lt;br /&gt;
  Max file locks            unlimited            unlimited            locks&lt;br /&gt;
  Max pending signals       24254                24254                signals&lt;br /&gt;
  Max msgqueue size         819200               819200               bytes&lt;br /&gt;
  Max nice priority         0                    0&lt;br /&gt;
  Max realtime priority     0                    0&lt;br /&gt;
  Max realtime timeout      unlimited            unlimited            us&lt;br /&gt;
&lt;br /&gt;
=== Systemd ===&lt;br /&gt;
  $ systemctl show open-xchange | grep Limit&lt;br /&gt;
  StartLimitInterval=10000000&lt;br /&gt;
  StartLimitBurst=5&lt;br /&gt;
  StartLimitAction=none&lt;br /&gt;
  MemoryLimit=18446744073709551615&lt;br /&gt;
  LimitCPU=18446744073709551615&lt;br /&gt;
  LimitFSIZE=18446744073709551615&lt;br /&gt;
  LimitDATA=18446744073709551615&lt;br /&gt;
  LimitSTACK=18446744073709551615&lt;br /&gt;
  LimitCORE=18446744073709551615&lt;br /&gt;
  LimitRSS=18446744073709551615&lt;br /&gt;
  LimitNOFILE=65536&lt;br /&gt;
  LimitAS=18446744073709551615&lt;br /&gt;
  LimitNPROC=65536&lt;br /&gt;
  LimitMEMLOCK=65536&lt;br /&gt;
  LimitLOCKS=18446744073709551615&lt;br /&gt;
  LimitSIGPENDING=19827&lt;br /&gt;
  LimitMSGQUEUE=819200&lt;br /&gt;
  LimitNICE=0&lt;br /&gt;
  LimitRTPRIO=0&lt;br /&gt;
  LimitRTTIME=18446744073709551615&lt;/div&gt;</summary>
		<author><name>Marens</name></author>
	</entry>
</feed>