Date: Mon, 12 Dec 2016 22:33:22 -0700 From: Warner Losh <imp@bsdimp.com> To: Peter Jeremy <peter@rulingia.com> Cc: Warner Losh <imp@bsdimp.com>, Ed Schouten <ed@nuxi.nl>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Sysctl as a Service, or: making sysctl(3) more friendly for monitoring systems Message-ID: <CANCZdfp2x9m8tD_aR2q_UVB_KoPwZEnUTsKMkDRcLm_ODsD-8A@mail.gmail.com> In-Reply-To: <B9B40604-B8E6-42A8-B5CB-41EDAE025911@bsdimp.com> References: <CABh_MKk87hJTsu1ETX8Ffq9E8gqRPELeSEKzf1jKk_wwUROgAw@mail.gmail.com> <eea0aa41-2bbc-0ddc-d951-f495c5ba2341@freebsd.org> <200A5D70-24CE-4843-B99D-E10A2AF4F68F@FreeBSD.org> <CABh_MKkAoTj4wA9oTz-fK0rokgMfuiUWpLt6t=qRXy6vvCh7rg@mail.gmail.com> <CANCZdfrjsLdMoZ9Eg19-mEbyxUefJxUmeq=cT_bagrJqzWnUOg@mail.gmail.com> <20161213052759.GP61036@server.rulingia.com> <B9B40604-B8E6-42A8-B5CB-41EDAE025911@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 12, 2016 at 10:29 PM, Warner Losh <wlosh@bsdimp.com> wrote: > >> On Dec 12, 2016, at 10:27 PM, Peter Jeremy <peter@rulingia.com> wrote: >> >> On 2016-Dec-12 17:57:07 -0700, Warner Losh <imp@bsdimp.com> wrote: >>> On Mon, Dec 12, 2016 at 6:34 AM, Ed Schouten <ed@nuxi.nl> wrote: >>>> $ 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. >> >> I think that's impressive as well. >> >>> 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. >> >> That sounds like a job for kqueue(2), though it would need to be plumbed >> through. The biggest problem I see is that nothing in the sysctl mechanism >> has any way of reporting that a value has changed and so consumers of that >> data should re-check. This means that you'd probably just wind up polling >> in the kernel. > > It does if you had a read-channel :) Yea, forgot about the pointer case, you're right. This is a cool idea, but it can't work. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp2x9m8tD_aR2q_UVB_KoPwZEnUTsKMkDRcLm_ODsD-8A>