From owner-freebsd-hackers Thu Nov 4 8:18:45 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from acl.lanl.gov (acl.lanl.gov [128.165.147.1]) by hub.freebsd.org (Postfix) with ESMTP id 4312C156D7 for ; Thu, 4 Nov 1999 08:18:40 -0800 (PST) (envelope-from rminnich@lanl.gov) Received: from localhost (rminnich@localhost) by acl.lanl.gov (8.8.8/8.8.5) with ESMTP id JAA1718417 for ; Thu, 4 Nov 1999 09:18:04 -0700 (MST) X-Authentication-Warning: acl.lanl.gov: rminnich owned process doing -bs Date: Thu, 4 Nov 1999 09:18:04 -0700 From: "Ronald G. Minnich" To: freebsd-hackers@FreeBSD.ORG Subject: Re: kstat - an API for gathering kernel stats In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG FWIW -- I think a reasonable goal of "getting stats out of the kernel" is that pulling data out ought to run as fast as bcopy, and it would be nice if you didn't have to drop into a syscall. Kind of an extreme position, I guess, but if you have ever seen the rstatd on linux eat 12% of cpu to return 10 samples/second you'd know why I want it. Given the slowness of some stuff (it takes linux 6 milliseconds to count up free/shared memory pages -- the code visits every page struct) bcopy speed is not a bad yardstick. Sysctl is much faster than reading files in /proc, but still too slow. How will kstat compare? how does it compare in solaris? Anybody got a bandwidth number? Numbers I have now (sorry, just for linux at present): Using files in /proc: awful, so slow it's not worth measuring exactly, something like 400 bytes in 20 milliseonds Using sysctl: Varies depending on the strategy and how much data you yank per variable, but O(1-10 Mbytes/second) ron To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message