From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 9 17:37:24 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C1AF1065678 for ; Sat, 9 Apr 2011 17:37:24 +0000 (UTC) (envelope-from joesuf4@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8C54C8FC15 for ; Sat, 9 Apr 2011 17:37:23 +0000 (UTC) Received: by vws18 with SMTP id 18so4155190vws.13 for ; Sat, 09 Apr 2011 10:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Tw1qDl9PwIDBDDpXmDcSfZ7qFR6nekDBFGfk+qK2pLU=; b=EQhMZxCf4PX+169dtFQS4dsBoapxmLs9wwl0Go4ml0OsrM9+eDLqF4/quh8UpLHwrh dnAAfWB67JCEDsGMsTM8cEDRNyMfFrz3sDNY5CTNpeLY/ZxadMVWcY1nRtbloQk7hYVT QtErvrxS1n/EEFJwnq0trJUzHeKFbBnjdJ4zs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JSySAFbClLanSdpQorbZqYqvK+/6Gu5Ycadut5L+r7jm/2EsFp1E/9KgELgR943XHY OfXdUfpYyRY0MCU3zFTQuD5eVf31OlunN241x6CNcJcuFiolwacwNeW+CZXFXziBY0CE +LGy2BjcU0yy6O07WotE+XosCQo1ls3ErVx4A= MIME-Version: 1.0 Received: by 10.52.165.134 with SMTP id yy6mr5079637vdb.312.1302369306657; Sat, 09 Apr 2011 10:15:06 -0700 (PDT) Received: by 10.52.187.73 with HTTP; Sat, 9 Apr 2011 10:15:06 -0700 (PDT) Date: Sat, 9 Apr 2011 13:15:06 -0400 Message-ID: From: Joe Schaefer To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: imposing memory limits in FreeBSD 8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2011 17:37:24 -0000 While I am thrilled about the newfound zfs stability that upgrading to 8 has brought, one of the things that seems to have been dropped is support for process memory limits. I have a few servers that occasionally run out of swap due to runaway httpd daemons, and the ulimit -m settings in the startup scripts we use stopped working upon upgrading from FreeBSD 6. I've tried fiddling with the daemon class in login.conf to no avail either. About the only thing I haven't tried is running httpd under djb's softlimit executable. Here's my daemon class in login.conf: daemon:\ :memoryuse=1g:\ :datasize=1g:\ :stacksize=1g:\ :tc=default: and proof that `limits` groks the config: # limits -eHC daemon ulimit -t unlimited; ulimit -f unlimited; ulimit -d 1048576; ulimit -s 1048576; ulimit -c unlimited; ulimit -m 1048576; ulimit -l unlimited; ulimit -u unlimited; ulimit -n unlimited; ulimit -b unlimited; ulimit -v unlimited; ulimit -p unlimited; ulimit -w unlimited; Any tips from admins who have successfully imposed memory constraints in 8.x?