From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 8 18:18:27 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F08BDC76; Fri, 8 Aug 2014 18:18:27 +0000 (UTC) Received: from systemdatarecorder.org (mail.systemdatarecorder.org [54.246.96.61]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "localhost" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7AC274D; Fri, 8 Aug 2014 18:18:26 +0000 (UTC) Received: from nereid (84-253-211-213.bb.dnainternet.fi [84.253.211.213]) (authenticated bits=0) by systemdatarecorder.org (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s78IG1Nr023133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Aug 2014 18:16:02 GMT Date: Fri, 8 Aug 2014 21:18:14 +0300 From: Stefan Parvu To: Ian Lepore Subject: Re: disk and NIC io statistics via sysctl Message-Id: <20140808211814.e14706bd0949b7a1a7827785@systemdatarecorder.org> In-Reply-To: <1407515358.56408.374.camel@revolution.hippie.lan> References: <20140808184021.537feca9b15e3a261ea27fa7@systemdatarecorder.org> <1407515358.56408.374.camel@revolution.hippie.lan> Organization: systemdatarecorder.org X-Mailer: Sylpheed 3.4.2 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 18:18:28 -0000 > magic secret kernel backdoor interfaces, all these userland tools are > using documented interfaces such as sysctl to get their info. (There > may be a few miscreants that open /dev/kmem and rudely poke around in > kernel memory, but I'm not sure we have any of them in base. The lsof > tool in ports is one that comes to mind for that.) Ian, understood - no magic here. I was looking to see if there are ready sysctl structures, arrays or hashes which can package already the mentioned stats. Like kern.cp_times, a very nice thing which is hidden and undocumented. I see very big improvement in sysctl and things are much organized since FreeBSD 5. But we will need better documentation. Im on iostat now - to understand how throughput per disk gets calculated. > In addition to the tools you've already mentioned that have the info you > want, have a look at gstat for IO stats, netstat for net throughput, and > systat for lots of stuff. gstat, thanks. havent used that. I will look over iostat, netstat. Probable would be nice to have a section on sysctl man page or probable something totally new which describes cpu | mem | disk | net and kernel statistics. Cheers, -- Stefan Parvu