Nice Performance Tuning For UNIX
Professor writes "Be 'nice' to your computers and examine some general guidelines for tuning server performance. A computer is like an employee who does tasks for you -- it's a good idea to keep from overburdening them. Keep this from happening by using the UNIX 'nice' command."
Performance tuning means that IO and other resources are sufficient to run tasks. The 'nice' command isn't that. 'nice' lets you run jobs whose complete time can vary, since you can put them on the bottom of the list.
/proc, and matching file and FS parameters with your page size.
Performance tuning is fiddling with
This is a non-article.
I want to delete my account but Slashdot doesn't allow it.
FTFA: "In fact, only the ps command was running when I generated this list. Most tasks are designed to do what they need to do quickly and then exit or sleep."
/proc/self for a while.
Of course, because all other processes, at the instant PS was running, were blocking on the CPU. In other words, on a uniprocessor system, you can only have one process running at a time, and in the case of a process that reports the state of other processes, its only THAT PROCESS THAT WILL APPEAR RUNNING...
Go play in
-- (appended to the end of comments you post, 120 chars)
Set 'em all to -19, and let the best program win! If they don't have to fight each other for CPU cycles they will grow up weak and feeble.
/etc/init.d/functions that takes a nice argument.
Very funny. Its like when I'm talking to people that believe in heaven and hell, I just say "Kill 'em all and let God sort them out!"
But back on the topic. Err, I'm new to UNIX/Linux, I've only been using it since 1993, but nice and getpriority() setpriority() and scheduling have been around for a _long_ time.
Debian launches services via the start-stop-daemon program that has the -N|--nicelevel option. RedHat has a function called daemon() in
In other words, I'm not impressed with the IBM article or with slashdot for printing this. Oh, and the slocate cron job in most Linux distros has been niced to -19 for years. I guess copying and pasting the contents of the cron script is helpful for people that don't have access to a Linux box. Next week, they are going to HTMLize the kernel source for those that can't download that either.
I hate being negative here, but what is the target audience for the IBM article and this slashdot reprinting of it?
I use it on my own system all the time. I've got a dual processor Mac, but once in a while I have too many things running in the background (encoding a movie, analyzing my data in Matlab, etc) and want to keep manipulating some images in the foreground, so I set Quicktime and Matlab and whatever else to -19 priority. They still finish, but when I need the processor to open/close/resize/apply a filter to my image, it takes it and then lets the rest work on the past stuff. I find that it can greatly increase the amount I get done in a day and makes my Mac feel as fast as it is when I'm not doing anything else.
I also tend to increase the priority on httpd processes on the same Mac since I host my website from it. It doesn't take much CPU time, but when a request comes in, I want it to respond as quickly as possible, so if I'm doing a lot, it will give priority to it.
Also, Boinc (the grid client for distributed computing) always sets all the jobs to -19 when they are run. I barely even notice if they are running in the background.
In short : nice doesn't change the total amount of time your processes take (or, at least, not by very much), it just changes which one finishes first.
Actually it does change the total amount of time. The issue in question here is about disk caching. The problem was that, if you run updatedb niced, then it doesn't get to run as often. In fact, it can run so infrequently that between one timeslice and the next, the disk cache has been replaced by other stuff, because of all the processes that ran in between the two.
The result is that updatedb runs with permanently cold cache. That makes it take hours instead of minutes. Hence the problem. It's not immediately obvious because it only happens when there is a moderate amount of background usage of disk resources - like an active mail server, or a backup job.
Nice isn't very nice to disk-intensive processes. This feature of unix was designed for cpu-intensive processes. It doesn't work very well on things like updatedb - you tend to get bad interactions like this one. If the system is truly idle then you're safe, but if it isn't then you're screwed.
I consider myself pretty "new" to the UNIX/Linux world, too, and I've been using some variation since 1993. I'll stop considering myself new when I can remember every command ;)
/. moderators slap me with an overrated moderation.
While we are on the topic, is there a market for a slashdot style site that is more geared for computer professionals?
Slashdot has a very smart userbase, and I would not abandon slashdot, but I would like to get away from the highschool and undergrad "know it all" people. Articles like this one are way below anyone who does Linux or UNIX professionally, and when I mention things like this the
I'm serious, would there be a target audience of professionals that would like a website geared for them? Does one already exist that I don't know about that has active readers and interactive discussions?