From owner-freebsd-security Tue Sep 4 9:12:41 2001 Delivered-To: freebsd-security@freebsd.org Received: from topperwein.dyndns.org (acs-24-154-28-172.zoominternet.net [24.154.28.172]) by hub.freebsd.org (Postfix) with ESMTP id DC09C37B403 for ; Tue, 4 Sep 2001 09:12:38 -0700 (PDT) Received: from topperwein.dyndns.org (topperwein.dyndns.org [192.168.168.10]) by topperwein.dyndns.org (8.11.6/8.11.6) with ESMTP id f84GCk947129 for ; Tue, 4 Sep 2001 12:12:46 -0400 (EDT) (envelope-from behanna@zbzoom.net) Date: Tue, 4 Sep 2001 12:12:41 -0400 (EDT) From: Chris BeHanna Reply-To: Chris BeHanna To: Subject: Re: Need help with limits(1) In-Reply-To: <48396009431.20010904114449@internethelp.ru> Message-ID: <20010904121057.C47041-100000@topperwein.dyndns.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, 4 Sep 2001, Nickolay A.Kritsky wrote: > Hi, all. > I have a webserver running on FreeBSD 3.3. One of the perl scripts > located there has some bug, that puts him in the infinite loop. This > causes my webserver to stall, so that the only way to reboot is > hardware reset. I want to restrict user httpd to use no more than > 75% of CPU time. I read man limits(1) and man getrlimit(2) but they > only talk about limiting cputime in seconds, but not percents. It > means that I can restrict httpd process to run no more than 10 > seconds, but in this 10 seconds it will have access to all CPU power > of the computer, making administrative work quite impossible. How > can I add percent-based cputime restrictions for various users and > login classes? I don't know of a way to limit a user to a given percent of CPU, but you might be able to limit the user's process priority, so that even though the user would get 100% of the CPU when his process runs, that process would be easily preempted by another process that has a higher priority. -- Chris BeHanna Software Engineer (Remove "bogus" before responding.) behanna@bogus.zbzoom.net I was raised by a pack of wild corn dogs. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message