Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use 'nice' to reduce File Sharing load? System
Many people have complained about File Sharing hogging processor cycles, and have reported better system behavior after disabling File Sharing.

I came across the UNIX command nice, which says you can, "invoke a command with an altered scheduling priority." I read this to mean that you could possibly start File Sharing with a lower processing priority, thus causing a reduced drain on system resources.

If anyone is savvy enough to try, please let us know.


[Editor's note: See the comments -- nice is broken in the current release of Mac OS X, so this command will have no impact].
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)

Use 'nice' to reduce File Sharing load? | 6 comments | Create New Account
Click here to return to the 'Use 'nice' to reduce File Sharing load?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
nice ?
Authored by: Anonymous on Mar 29, '01 06:13:03PM

Well it depends... it should work...

I just started macosx final, and I haven't explored it... but if it has the nice command as other unix systems do, then you should be able to run any processes with the nice <command> to lower the load priority on it.

I've notice on the final release... apple has remove a lot of stuff from the public beta... ssh, and etc. :( So I haven't confirm if nice is there or not.

[ Reply to This | # ]
nice ? -and ssh
Authored by: Anonymous on Mar 29, '01 10:04:47PM

ssh, at least, is restored in the 10.0.1 update (unauthorized) floating around on carracho.

[ Reply to This | # ]
Re: Use 'nice' to reduce File Sharing load?
Authored by: Anonymous on Apr 04, '01 06:07:20PM

Mac OS X has both the nice and renice commands installed. (renice is used to 'nice' a
running application.) Strangely, related commands getpriority and setpriority don't
seem to work.

I haven't yet figured out where the System keeps its startup shell scripts, so I'm not
sure how to nice the filesharing process at boot time. You can do it once the system is
up by typing:
sudo renice +5 <PID#>
where <PID#> is the Process ID, which you can get from "top". This will only work until
the machine is restarted. Here I've added 5 to the priority.

Priorities range from -20 to 20, 20 being lowest. Most everything is (and should be) priority

I have to say I'm a little mystified that people are blaiming filing sharing for OS X's
performance problems. My AppleFileServer process just sits there; I threw 70 MB of quicktime
video at it a few hours ago, and it used up 13 cpu seconds while handling them. Since then,
it's used just 2 more cpu seconds. This doesn't look like the cause of a performance problem to me.


[ Reply to This | # ]
Using nice on Apple File Sharing
Authored by: Anonymous on Apr 05, '01 03:53:53PM

OK, I found where the startup scripts live.

But let me say again, I think it is a bad idea to mess with this, because I don't think
AppleShare is causing performance problems. (This means I also haven't tried and am not
going to try doing the following.)

Startup scripts in MacOS X are stored in /System/Library/StartupItems.

In here, you'll find folders for the various programs MacOS X starts while booting. Each
process (application) has its own folder. In the folder is a text file with the name of
the process. This is the shell script that starts that process. The Apple File Server
script looks like this:

. /etc/rc.common

# Start the AFP Server
if [ "${AFPSERVER:=-NO-}" = "-YES-" ]; then

if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi

ConsoleMessage "Starting Apple File Service"

AppleFileServer &
Change: (Actually, don't change, because I don't think you should do this!!!)

AppleFileServer &


Nice -n 5 AppleFileServer &

Now we know how to do it. Should we? No, no, no, no, no, no! But we'll savor the
power that we *could* if we wanted to.


p.s. Apple's startup script implementation is sweet, isn't it!?

[ Reply to This | # ]
Using nice on Apple File Sharing
Authored by: oeyvind on Apr 06, '01 04:00:01AM

Just FYI: nice/renice command DOES NOT have any effect on the current MacOS X/Darwin as of now-it's broken.

[ Reply to This | # ]
Using nice on Apple File Sharing
Authored by: Anonymous on Apr 06, '01 04:47:12PM

Ok, thanks. Just saw that in the other thread going on here...


[ Reply to This | # ]