Date: Wed, 4 Dec 2002 12:01:43 -0600 (CST) From: Mike Silbersack <silby@silby.com> To: Stijn Hoop <stijn@win.tue.nl> Cc: freebsd-hackers@freebsd.org Subject: Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle] Message-ID: <20021204114915.Q41338-100000@patrocles.silby.com> In-Reply-To: <20021204113154.GA205@pcwin002.win.tue.nl> References: <20021202151816.GJ83264@pcwin002.win.tue.nl> <20021202114019.R31106-100000@patrocles.silby.com> <20021204113154.GA205@pcwin002.win.tue.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 4 Dec 2002, Stijn Hoop wrote: > With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am > indeed seeing much better times on this 'benchmark'. See attached log. Not > only the _select_sleep method benefits from this. What are the reasons *not* > to do this? > > > As to why Linux may appear "better"... I believe that Linux defaults to > > hz=100, but that the default switched to hz=1000 sometime in the recent > > past. > > And why don't we do the same? (I suspect this is related to the question > above :) Well, it's generally believed that in the common case (around 100 processes, and/or with well behaved processes that voluntarily give up their timeslice) that 100 context switches per second is enough for smooth performance. Whether this is true or not as you hit 500+ processes on a busy server is unknown, I don't believe that anyone has done benchmarking. One argument against more frequent context switches when you have < 100 processes is that you will be invalidating the contents of the various caches more often, leading to less efficient overall performance. The same argument could also be made for the VM system if the system is under memory pressure. On the other hand, a higher HZ should create a system which runs a bit smoother for interactive programs. And, as you point out, it is necessary for good timing in emulators / simulators / dummynet. In short, I don't think the issue has been discussed much, partially because it's so easy for those who want hz=1000 to just edit loader.conf. If you want to propose that we switch to hz=1000 by default: 1. Make a list of applications / setups that benefit from hz=1000. 2. Wait until after 5.0-release is out the door. 3. Pose your question on -arch. Good luck. :) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021204114915.Q41338-100000>