<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rctl on Artur Meski</title>
    <link>https://meski.io/tags/rctl/</link>
    <description>Recent content in Rctl on Artur Meski</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Fri, 09 Sep 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://meski.io/tags/rctl/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Limiting resources on FreeBSD</title>
      <link>https://meski.io/posts/rctl/</link>
      <pubDate>Fri, 09 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://meski.io/posts/rctl/</guid>
      <description>&lt;h1 id=&#34;what-is-rctl&#34;&gt;What is &lt;code&gt;rctl&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;p&gt;In FreeBSD, in addition to &lt;code&gt;login.conf&lt;/code&gt;, we also get a very nice and&#xA;flexible mechanism for setting resource limits: &lt;code&gt;rctl&lt;/code&gt;.&#xA;I like it in particular for limiting resources allocated to each jail.&lt;/p&gt;&#xA;&lt;h1 id=&#34;configuration&#34;&gt;Configuration&lt;/h1&gt;&#xA;&lt;p&gt;Here is a short example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;jail:example_jail:vmemoryuse:deny=2G/jail&#xA;jail:example_jail:maxproc:deny=200/jail&#xA;jail:example_jail:readiops:throttle=500/jail&#xA;jail:example_jail:pcpu:deny=70/jail&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the above, for the jail identified by &lt;code&gt;example_jail&lt;/code&gt; we allow:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;2G of memory,&lt;/li&gt;&#xA;&lt;li&gt;200 processes,&lt;/li&gt;&#xA;&lt;li&gt;500 I/O read operations per second,&lt;/li&gt;&#xA;&lt;li&gt;70% of CPU.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;enabling-rctl-on-boot&#34;&gt;Enabling rctl on boot&lt;/h1&gt;&#xA;&lt;p&gt;Actually, there is no need to enable anything in &lt;code&gt;rc.conf&lt;/code&gt; &amp;ndash;&#xA;this is what you can find in &lt;code&gt;/etc/defaults/rc.conf&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
