From nobody Tue Aug 03 13:50:55 2021 X-Original-To: jail@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CEC9212DADCF for ; Tue, 3 Aug 2021 13:50:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfGVQ5Bk9z4X0w for ; Tue, 3 Aug 2021 13:50:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2e.google.com with SMTP id f91so10583464qva.9 for ; Tue, 03 Aug 2021 06:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=71eB9m6CTkeEylcrGs1ZJ5I/qfbvFJlcHKutTKu1YxI=; b=DRhOZ3UA5B2Fyopvw4kuGYc/RU3aTNdXMnFwmPcl4HvpqJwsI/BHIxbNaWCPiuXlDb rVAJPibQSm3OFtl8ut3ksV+EXZCIxL0sI2lnYxmrQteEZRBNBdA+HAR4H56lxOeG4u6L hkoUDbdrf/7aLRRUvSPYvBxMP58V0/btrg1FVo0b5xOHYBtYFWS0ax6qgBJGGoFW7r8H AvCscJdcNWs2/oHRO2eoqsKy60A9ikk9ge2wdQhErGg57ddQ/WpRqtQMhQTPT2gYK1WT JRO0eWuKVDcqxIDTEv2ljO6v2SijdJ0a+R6zlwz7vTbi2ZFLwPD9hfvraCId6WwHLCNw ZHzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=71eB9m6CTkeEylcrGs1ZJ5I/qfbvFJlcHKutTKu1YxI=; b=agUhCZcFP02037XiZSh356g99Evs7jD6mGUarsl9nJrU3BV772G6jKK4YqfnKeULDX cb94S902G5kFllELOu4N8yVOQ3o/2ND3QrM86mzs+F270405tdIHakJgtMxqypZZASXN pNBqJHTeGUfqvSYk0SjHPor1FsxuffeRSq/4cOcPiH3DLlK5DUJQqoN3DZHvdAAtXj7Z 0uASXz/nqSm/zqy8rqsmCK2RXot3Psw2We0wXcA3V44RNRef+cx4Pivo9zGVpsRQrtBl gG8mY3sirXIvTtPIJzyK4DJj0P0pLkHnjUxCkJ3cV+0K4NovCSaYyZOxa0dLMgPZcLgN yOqQ== X-Gm-Message-State: AOAM531Eev6T6nby0UobKUzQRBjsUUbW89RHcj61rKEliUNg8F0imGuj 832AkwbvD7WtZfYFf5LIRmw= X-Google-Smtp-Source: ABdhPJyWQMAO3o7kAEl/UMOQWadFAuDpPP/WIrweyazr/ageVIYrHfenCOgYdfz1NCXAFoZTSdoBKQ== X-Received: by 2002:a0c:ff01:: with SMTP id w1mr21658635qvt.28.1627998654415; Tue, 03 Aug 2021 06:50:54 -0700 (PDT) Received: from nuc ([142.126.162.193]) by smtp.gmail.com with ESMTPSA id r5sm5974326qtm.75.2021.08.03.06.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 06:50:54 -0700 (PDT) Date: Tue, 3 Aug 2021 09:50:55 -0400 From: Mark Johnston To: Thomas Steen Rasmussen Cc: Michael Gmelin , jail@freebsd.org, Konstantin Belousov Subject: Re: POSIX shared memory, jails, and (lack of) limits Message-ID: References: <51d4462f-1958-3380-9973-365e018e533f@gibfest.dk> List-Id: Discussion about FreeBSD jail(8) List-Archive: https://lists.freebsd.org/archives/freebsd-jail List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-jail@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51d4462f-1958-3380-9973-365e018e533f@gibfest.dk> X-Rspamd-Queue-Id: 4GfGVQ5Bk9z4X0w X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Aug 02, 2021 at 09:58:08PM +0200, Thomas Steen Rasmussen wrote: > On 8/2/21 9:40 PM, Mark Johnston wrote: > > Cyril has written a few patches for racct, including one which includes > > POSIX shared memory objects in rctl's "nshm" and "shmsize" resources, > > which currently only apply to SysV shm objects: > > https://reviews.freebsd.org/D30775 > > We plan to get them committed in the next couple of weeks. > > > Hello, > > I haven't looked at it for a bit, but the last time I tried to use > sysutils/jail_exporter to get graphs for jail resource usage the graphs > for Postgres jails were hilariously wrong, which I believe I tracked > down to shared memory being counted more than once. > > I gave up trying to figure out how to fix it and just lived with Grafana > telling me a postgres jail on a 128gb jailhost used 900gb of memory. > > But it sounds like the above might fix this? I'm not familiar with jail_exporter, which resource counters is it fetching? I doubt this change on its own will solve the problem, it simply includes POSIX shm objects in racct's shared memory accounting. The mechanisms we use for memory usage are not changed there.