From owner-freebsd-hackers@freebsd.org Tue Dec 13 00:57:09 2016 Return-Path: Delivered-To: freebsd-hackers@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 71C22C73FFE for ; Tue, 13 Dec 2016 00:57:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37EF61108 for ; Tue, 13 Dec 2016 00:57:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id p13so25342010ioi.0 for ; Mon, 12 Dec 2016 16:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0/KZbHC0XIcX7G58UmHOKjTIMly7Ii8Vp2/ppD6A9aY=; b=LY+lKKo5/FcaVhzjXQN9Ku3wLWpj/0r61S114bEgG8Jb8hHE8++MyNGqiQYX1gCWdL 4mJirLj5bYy1aybYCHIl0Xnf1aYxKjft20wcXPx7qSFWxtLGbs7BrzaPtAKMH6hAipx2 6toBUmhrVWHgJ+sK7eVPnP8ludHTmmVhYErMsc+LQ0Myj+cd4XEiOmbGCucJEZZKzmwP +vc2SMYabRIufe9bkb8C22c/vHRTZ+qPAFNELedMEwpL1eoDLjXLGH+zmn048zuEXmDJ c/a+5xAApG8IXoRpNxyg2lSHabpOBo2ZeM9EfZuKl092dxlUONW4a9MG1nE2QjQcjHvQ /JTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0/KZbHC0XIcX7G58UmHOKjTIMly7Ii8Vp2/ppD6A9aY=; b=GT8Dyx16b2ih2GRPWFNIj8OG/ab/LQDKQu2B2qAgTiNC4gxpsR7oeojf6rCfYgQwF1 0iH5lbrMXIfu2HtuI96j+uWeOFPYA3Xx+f4xmMdC7It41WH1vM7ACr+nvRy0e2fsAnsy 8JAEu5X3Y0GDZF0vQeS3rifjFnwPmCeCfuSfFy1sf9NMTlgMPawIWVv4nHOLOcj2oR7t kTZGtXM4DUlZ3AFcVkHQ1ytP41P02BR1lD1OS9Zg38n+8heVC3uL/9RO/TuH4TYK5CyH hqWuOGDxFO/B5MidyCyzizRLQ3qcjXabFl9MhOfQ1RtFfIqdhqjylFMNKdFu7R8VnPhm ADwQ== X-Gm-Message-State: AKaTC00iuhqQJ9zGICOKqWGAf1wMlJ8J2ZY2V5jjrKEdytgPwbNbmSCgkSx9+8kxNQPbxSxDDKGl5yXfgzuX4g== X-Received: by 10.107.132.74 with SMTP id g71mr84128075iod.19.1481590628435; Mon, 12 Dec 2016 16:57:08 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Mon, 12 Dec 2016 16:57:07 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <200A5D70-24CE-4843-B99D-E10A2AF4F68F@FreeBSD.org> From: Warner Losh Date: Mon, 12 Dec 2016 17:57:07 -0700 X-Google-Sender-Auth: _w2hk19iUdtpBe7uHY3Rc99r0KA Message-ID: Subject: Re: Sysctl as a Service, or: making sysctl(3) more friendly for monitoring systems To: Ed Schouten Cc: Jonathan Anderson , FreeBSD Hackers , Allan Jude Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 00:57:09 -0000 On Mon, Dec 12, 2016 at 6:34 AM, Ed Schouten wrote: > Hi Jonathan, > > 2016-12-11 21:12 GMT+01:00 Jonathan Anderson : >> Rather than doing lots of system calls to >> enumerate clearly-related sysctl values, it would be very cool to do one >> system call and then inspect the resulting data structure in memory. > > I'm not sure it's worth tackling this problem at this time. My current > version of the exporter is already pretty fast: > > $ time ./prometheus_sysctl_exporter | wc -l > 0.00 real 0.00 user 0.00 sys > 3162 > > If our sysctl tree would get substantially larger at some point, we > should of course revisit this. That sounds cool. I'd love to see what you came up with to get those results. While we're here... there's one thing I'd love to see from a hypothetical /dev/sysctl... When a sysctl value changes (or some subset), I'd like it to appear on a read-channel. That way, I could monitor temperature w/o needing to constantly poll for changes, for example. Warner