From owner-freebsd-jail@freebsd.org Thu Nov 7 04:43:38 2019 Return-Path: Delivered-To: freebsd-jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 277651A6F21 for ; Thu, 7 Nov 2019 04:43:38 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from resqmta-po-10v.sys.comcast.net (resqmta-po-10v.sys.comcast.net [IPv6:2001:558:fe16:19:96:114:154:169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 477rQ03Mvcz45gr for ; Thu, 7 Nov 2019 04:43:35 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from resomta-po-11v.sys.comcast.net ([96.114.154.235]) by resqmta-po-10v.sys.comcast.net with ESMTP id SZSWi9LW9ztAoSZdtiGQAw; Thu, 07 Nov 2019 04:43:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20180828_2048; t=1573101813; bh=TrDPlrretfTHDtHQWPUbnN5glrsAoW8k24jEc5KLs6M=; h=Received:Received:Received:Received:Date:From:To:Subject: Message-ID:MIME-Version:Content-Type; b=p0TGIzVg9o+ndOCwrFoJnwli7YYKwOa+M1hkYXvAFiLZggUO1JrqoP06sXi5PRdop juZGTmcLcEHpCAScQECx5gwMgpvTH/Au0yexyzDqbhudZKSIq/oWy+MUAQpQnykUFI VAcLiJ6HbnsmnO+eIaACTkpwv029CVnCHJ+pyUvR9IKG0ZI6MTO223sfuA1Z9E6F6Y 2mGDK4dwezbsLE9s5iytLF5AE4SrZfqKKo5R31X6i1bKiFpaVjIDWiKUuegw4VccF7 JM4cIDYaS8YEW/Fy9WKePSkJ6RMwXz4Kzu5BqV83WDZapC0MCP4/+gYohzMMcaH1wt 34zDX76ZIIMOw== Received: from misty.eyesbeyond.com ([73.225.117.129]) by resomta-po-11v.sys.comcast.net with ESMTPA id SZdriI4vUnhpNSZdsiXXD9; Thu, 07 Nov 2019 04:43:33 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedufedruddukedgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtuggfsehttddttddtredvnecuhfhrohhmpefirhgvghcunfgvfihishcuoehglhgvfihishesvgihvghssggvhihonhgurdgtohhmqeenucfkphepjeefrddvvdehrdduudejrdduvdel X-Xfinity-VMeta: sc=0.00;st=legit Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.15.2/8.15.2) with ESMTP id xA74hVHV012635 for ; Wed, 6 Nov 2019 20:43:31 -0800 (PST) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: Host localhost.eyesbeyond.com [127.0.0.1] claimed to be misty.eyesbeyond.com Received: (from glewis@localhost) by misty.eyesbeyond.com (8.15.2/8.15.2/Submit) id xA74hVOO012634 for freebsd-jail@freebsd.org; Wed, 6 Nov 2019 20:43:31 -0800 (PST) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Wed, 6 Nov 2019 20:43:31 -0800 From: Greg Lewis To: freebsd-jail@freebsd.org Subject: Jail resource limits? Message-ID: <20191107044331.GA12545@misty.eyesbeyond.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 477rQ03Mvcz45gr X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=comcastmailservice.net header.s=20180828_2048 header.b=p0TGIzVg; dmarc=none; spf=none (mx1.freebsd.org: domain of glewis@eyesbeyond.com has no SPF policy when checking 2001:558:fe16:19:96:114:154:169) smtp.mailfrom=glewis@eyesbeyond.com X-Spamd-Result: default: False [1.95 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[comcastmailservice.net:s=20180828_2048]; NEURAL_HAM_MEDIUM(-0.93)[-0.933,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-0.13)[ipnet: 2001:558::/29(-0.48), asn: 7922(-0.12), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-jail@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.59)[-0.586,0]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[comcastmailservice.net:+]; DMARC_NA(0.00)[eyesbeyond.com]; HFILTER_HELO_5(3.00)[resqmta-po-10v.sys.comcast.net]; R_SPF_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[129.117.225.73.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:7922, ipnet:2001:558::/29, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[9.6.1.0.4.5.1.0.4.1.1.0.6.9.0.0.9.1.0.0.6.1.e.f.8.5.5.0.1.0.0.2.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 04:43:38 -0000 Hi all, I've been playing with limiting FreeBSD jail resources with both cpuset and rctl and I wondered if anyone knew of a way to tell from inside the jail what these limits are? E.g. let's say I use cpuset to limit a jail to CPU0 and rctl to limit a jail to only using up to 4G of memory. Can I then tell from a process running inside the jail that these limits are in place? I tried dumping out sysctl -a and couldn't see anything that seemed to match up with the limits I put in place. I haven't yet tried writing some code to call cpuset(2) to see if that works. The reason I'm asking is that some software may make decisions based on the resources available and I'd like to have a way to accurately determine those resource limits for jailed processes. Any pointers appreciated. -- Greg