From owner-freebsd-hackers@freebsd.org Mon Oct 26 15:56:50 2015 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 A66288676 for ; Mon, 26 Oct 2015 15:56:50 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 84BD01C13 for ; Mon, 26 Oct 2015 15:56:50 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 66ED6D001 for ; Mon, 26 Oct 2015 15:56:44 +0000 (UTC) Subject: Re: vmtotal consumes significant portion of cpu cycles To: freebsd-hackers@freebsd.org References: From: Allan Jude Message-ID: <562E4D3F.8080204@freebsd.org> Date: Mon, 26 Oct 2015 11:56:47 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uI6NcDOoMFCR8POgvpaSlpLiCWWjfL7H3" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2015 15:56:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uI6NcDOoMFCR8POgvpaSlpLiCWWjfL7H3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2015-10-26 09:28, Jia-Shiun Li wrote: > Hi all, >=20 > I noticed that 'sysctl -vm 1' consumes about 5% cpu time on a machine w= ith > 2x 6-core Xeon E5v3 and 64GB memory. That's a lot for a monitoring tool= =2E >=20 > After digging a while I found that it is vmtotal() in kernel that consu= mes > major cycles. When memory usage is high the cost of vmtotal() rises too= =2E It > is reproducible with sysctl when memory utilization is high: >=20 > % time repeat 100 sysctl vm.vmtotal > /dev/null > 0.055u 8.102s 0:08.19 99.5% 31+175k 0+0io 0pf+0w >=20 > % top > last pid: 40272; load averages: 0.32, 4.74, 8.01 up 3+01:19:54 > 17:23:59 > 58 processes: 1 running, 57 sleeping > CPU: 0.1% user, 0.0% nice, 1.6% system, 0.1% interrupt, 98.3% idle > Mem: 4509M Active, 52G Inact, 2819M Wired, 1572M Buf, 2930M Free > Swap: 3598M Total, 3598M Free >=20 > PID USERNAME THR PRI NICE SIZE RES STATE C TIME CPU > COMMAND > 46841 root 30 20 0 9248M 7930M kqread 9 20.8H 11.88% b= hyve > 49914 jsli 1 23 0 19320K 3884K select 5 134:08 4.79% s= ystat >=20 >=20 > In FreeBSD source tree systat and vmstat are major user. Other tools li= ke > bsnmpd may use it too via sysctl. >=20 > I don't have idea yet how this can be improved. Shall I create a bug to= > keep track of it? >=20 >=20 > -Jia-Shiun > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >=20 In the first 2 references you say 'sysctl', do you mean 'systat' in all instances? --=20 Allan Jude --uI6NcDOoMFCR8POgvpaSlpLiCWWjfL7H3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJWLk1CAAoJEBmVNT4SmAt+Lb0QAI5UjbsmNPLso7XGNTZenMLR yFGdVMdNYq+AcjP32PlKWUDrqdu/psHRgadX3PEpCrHZyfvaJUf7d7avzMK4/c7+ lLV953fn8B1ZWm4H45Paa7rG7UUB5Lj5iEhdQiCeP/WC1O5YbW6o1s2iOhL1E6fE uwIqO3v7wLTz48cRKAWnNRP3TxaB3NO/DroEMI5N8/IaQFV2yFS/oeue9TSo89lN j92E+9n6aOlJIYbWb0n+20F4m6H7pEB8dpCLcSi63J+kLjU15HHgk/M7lkf3Au7t lkbASff7xTnEs7R5dZZxtoZX1i0CWyl2YR3CoYr9gOcmeBTxCkd/OZyvnOx5yjed ziCQwCfi5oois/2flL4xQBydRg1ACVXNShWvTC9w/BvbR/FAoipOik2Rv0XP4dJJ cC02uBcFzJv605EPvlxCA9w0xk/QlbbuAdecduRrUm8QLTuV+g3AXUb4RTkbS/SA DUlmXub3EsyrRPCVsf+eOuVwMlvkvg7itD810MATnUG8dyPPsc3BffmPR2uIf9d7 7PP7QvWG7dKcwOc95+CXHaM3Z24eqBBFgBPt9ycLcaLQ6DDvecQKGv/XqtBZoi6P QTe1rjRD2+cKlMBQXCC+Te94evChsUvdkL0/3S00LprYQoB6YZPkJdSDEaiJDOX+ BDPUnHE/lK+YqnrptAx5 =JsuQ -----END PGP SIGNATURE----- --uI6NcDOoMFCR8POgvpaSlpLiCWWjfL7H3--