https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082007-06-11T00:08:00ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #693: heavy swapping may kill system?https://bugs.dragonflybsd.org/issues/693?journal_id=29382007-06-11T00:08:00Zmemmerto
<ul></ul><p>IMO, this is what ulimit (and friends) are for.</p>
<p>Here's what ulimit says on my 1.9 box:</p>
<p>root@jekell# ulimit -a<br />cpu time (seconds, -t) unlimited<br />file size (512-blocks, -f) unlimited<br />data seg size (kbytes, -d) 524288<br />stack size (kbytes, -s) 65536<br />core file size (512-blocks, -c) unlimited<br />max memory size (kbytes, -m) unlimited<br />locked memory (kbytes, -l) unlimited<br />max user processes (-u) 3214<br />open files (-n) 6429<br />virtual mem size (kbytes, -v) unlimited<br />sbsize (bytes, -b) unlimited<br />root@jekell#</p>
<p>With unlimited <del>m/-v/-b/-f/-t settings, there's nothing to restrict a<br />process from attempting to consume more memory (phys or virt) or CPU than is<br />available. In your case, having -m/-v set to reasonable limits would have<br />prevented uw-imap from bringing down the system -</del> as once those limits were<br />exceeded, a malloc or shmget would have failed and the process would have<br />likely died - instead of bringing down the system.</p>
<p>It seems to me that in the BSD world, the default limits are quite<br />permissive (ie, unlimited), whereas in the "commercial" Un*x world (ie, AIX,<br />Solaris, etc) the ulimits are set to reasonable restrictive limits. On the<br />AIX boxes I use, I always end up having to change my ulimit sessions since<br />files get truncated at 1G, and applications fail because they can't allocate<br />enough memory and core files always get truncated. It's quite a pain, but<br />it's also quite useful from an administration POV since rogue users aren't<br />abel to take the system down.</p>
<p>Regards,<br />--<br />Matt Emmerton</p> DragonFlyBSD - Bug #693: heavy swapping may kill system?https://bugs.dragonflybsd.org/issues/693?journal_id=29392007-06-11T00:33:00Zdillon
<ul></ul><p>:I had a DragonFly 1.8.2 system lock up on me completely - even the console<br />:was frozen. All that was printed was a long series of this:<br />:<br />:swap_pager_getswapspace: failed<br />:<br />:I hit the power button and rebooted, but I've noticed an ongoing series of<br />:this: (from dmesg)</p>
<pre><code>Unless the swap usage is creating a memory leak, I think the two might<br /> be unrelated.</code></pre>
<p>:> pid 788 (imapd), uid 1006: exited on signal 6<br />:> pid 806 (imapd), uid 1006: exited on signal 6<br />:> pid 815 (imapd), uid 1006: exited on signal 6<br />:> pid 825 (imapd), uid 1006: exited on signal 6<br />:> swap_pager_getswapspace: failed<br />:> swap_pager_getswapspace: failed<br />:> swap_pager_getswapspace: failed<br />:> swap_pager_getswapspace: failed<br />:(repeat...)<br />:<br />:Investigating, one of the user accounts has some multi-gigabyte backup<br />:files in ~, and imap-uw is trying to index them as mail messages. The<br />:error here lies either in my configuration or imap-uw, but: it appears to<br />:have locked up the system after a while. Should that runaway application<br />:have been able to bring down the entire computer that way?</p>
<pre><code>No, the worse that should happen is that the kernel will kill the<br /> largest offending processes on the system, which is what it did. At<br /> least theoretically.</code></pre>
<pre><code>-Matt<br /> Matthew Dillon <br /> &lt;<a class="email" href="mailto:dillon@backplane.com">dillon@backplane.com</a>&gt;</code></pre> DragonFlyBSD - Bug #693: heavy swapping may kill system?https://bugs.dragonflybsd.org/issues/693?journal_id=29482007-06-11T06:34:02Zjustin
<ul></ul><p>I've noticed it went though several iterations of swapspace errors and the<br />IMAP server being killed; it could be that activity, combined with<br />something else that was going on, was enough to trigger a problem.</p>
<p>I'll keep an eye on it; I haven't been able to get it to repeat again.</p> DragonFlyBSD - Bug #693: heavy swapping may kill system?https://bugs.dragonflybsd.org/issues/693?journal_id=71192009-08-23T17:28:19Ztuxillo
<ul></ul><p>Weeks ago, I did an stupid test on my system. I tried badly to kill the system<br />by taking up all the memory I could, in the hope of crashing the system. The<br />offending big memory consumers were just killed and the kernel end up flawlessly.</p>
<p>Justin, did you have similar issues? Can we close this ticket?</p> DragonFlyBSD - Bug #693: heavy swapping may kill system?https://bugs.dragonflybsd.org/issues/693?journal_id=71212009-08-23T20:56:49Zjustin
<ul></ul><p>Marking resolved. The original circumstance where imap-uw was reading huge<br />non-mail files hasn't happened again, but then again neither has the crash.</p>
<p>I'll mark this closed.</p>