From owner-freebsd-hackers Sun Feb 14 18:41:44 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA17489 for freebsd-hackers-outgoing; Sun, 14 Feb 1999 18:41:44 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from schizo.cdsnet.net (schizo.cdsnet.net [204.118.244.32]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA17484 for ; Sun, 14 Feb 1999 18:41:43 -0800 (PST) (envelope-from mrcpu@internetcds.com) Received: from localhost (mrcpu@localhost) by schizo.cdsnet.net (8.8.8/8.7.3) with SMTP id SAA10192 for ; Sun, 14 Feb 1999 18:36:21 -0800 (PST) Date: Sun, 14 Feb 1999 18:36:20 -0800 (PST) From: Jaye Mathisen X-Sender: mrcpu@schizo.cdsnet.net To: hackers@FreeBSD.ORG Subject: Processor affinity? 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 Noticed somethign a little odd with a 3.1-stable supped a few days ago. There were only 3 processes of any significance running on a dual processor P6. mysql, top, and a perl script pumping kazillions of small records into the mysql database. The perl script was basically burning 99.9% of the CPU. Mysql was chewing up 40-60% of the CPU. For some reason that on the suface does not make sense to me, the perl script moved back and forth among the CPU's, just about like clockwork, every update or so of top. This seems odd to me, in that given the size of the program (small), and the amount of CPU burning, it would be better if the perl process stayed stuck to 1 CPU to maximise the use of the cache (512k) of that CPU, instead of having to wander around. Is there some way to set processor affinity on a process? Or some tweak to some sysctl variable somewhere that I can take advantage of? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message