From owner-freebsd-questions@freebsd.org Fri Aug 19 09:57:37 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91AE4BBFF8D for ; Fri, 19 Aug 2016 09:57:37 +0000 (UTC) (envelope-from steve@sohara.org) Received: from smtp3.irishbroadband.ie (smtp3.irishbroadband.ie [62.231.32.5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA541D60 for ; Fri, 19 Aug 2016 09:57:37 +0000 (UTC) (envelope-from steve@sohara.org) Received: from [89.127.62.20] (helo=smtp.lan.sohara.org) by smtp3.irishbroadband.ie with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1bagIM-0003qr-Un for freebsd-questions@freebsd.org; Fri, 19 Aug 2016 10:40:59 +0100 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bagIh-0008a0-M8 for freebsd-questions@freebsd.org; Fri, 19 Aug 2016 09:41:19 +0000 Date: Fri, 19 Aug 2016 10:40:58 +0100 From: Steve O'Hara-Smith To: freebsd-questions@freebsd.org Subject: Re: How do I limit I/O usage for a user/process? A user broke my system Message-Id: <20160819104058.1c60a63fb832fbdc1524207c@sohara.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 09:57:37 -0000 On Fri, 19 Aug 2016 09:23:16 +0000 Magnus Ahriman wrote: > Hi, > > Today I had a user who decided to open a very large text file in pico. The > result was a complete denial of service of the system and everything > stalled/was working veeeeery slowly. How much memory have you got on that box, and how much is in use normally ? It sounds like the system got pushed into swapping by opening that file. > Even after the user had killed the process it took quite some while for > the system to recover and I seemed to notice improvements of certain > services after having restarted them. > > What are my options to limit resource usage for users? I tried renicing Take a look at login.conf it lets you define many limits by login class - you can assign users to classes using vipw or chpass and of course with adduser when adding new users. > the user's process but to no help and the problem was most certainly with > disk I/O. I don't want a normal user being able to lock up my entire > system just by viewing text files. So any ideas? Very likely the problem was due to memory use and you are tight on memory for your normal load. -- Steve O'Hara-Smith