The conversation on this page has been archived and is no longer active.

HD spin down and sleepy mac

Message #1 - Posted 2005/05/04 - Karl Zag4n

Hi,

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

In System preferences it is too limited for my taste. I think in Linux it has hdparms, but that doesn't seem to exist in os X. And the thing is it is a SCSI not IDE disk (which is connected via a SCSI card) which I want to control the spin down time on. Currently it spins down way too soon (about 10 minutes or so setting System Preferences>Energy Saver>Sleep>Put the hard disk(s) to sleep when possible

Question 2:

Why the hell does OS X go to sleep when the computer is doing something ? OS 9 didn't do that.

Example leave bittorent downloading something overnight.
Or doing a long 3d render overnight.

Wake up and find the computer is asleep on the job.

I know you can turn off sleep in Energy Saver, but it seems a huge flaw that OS X is apparently testing user input as a measure of inactivity, not CPU/disc/network use.

thanks

Message #2 - Posted 2005/05/04 - Jeff Wiseman

Karl Zag4n wrote:

Question 2:

Why the hell does OS X go to sleep when the computer is doing something ? OS 9 didn't do that.

Example leave bittorent downloading something overnight.
Or doing a long 3d render overnight.

Wake up and find the computer is asleep on the job.

I know you can turn off sleep in Energy Saver, but it seems a huge flaw that OS X is apparently testing user input as a measure of inactivity, not CPU/disc/network use.

Since in a Unix based system, there are ALWAYS many processes running and disk activity 24/7. You would have to somehow designate a difference between processes that you will allow to be interrupted for a sleep and those that you did not. OS 9 had nothing like this. As a result, the only way to define "no activity" in something like OS X is when the keyboard and mouse havn't been used for a while (i.e., no USER activity). The OS X system is always active from a straight process running viewpoint.

The sleep function IMHO might have only been implemented on these things to comply with energy saver standards. Most UNIX based systems are run 24/7 (e.g. Solaris workstations). The real issue is having your LCD monitor backlights shut down when someone is not there watching them so that they last longer. Keyboard and mouse activity is a good way to tell if someone is there looking at the screen. They just used the same very simple detection mechanism to initial sleep since anything else is going to be far more complex and would require all kinds of user provisioning (e.g. the user would have to specify the types of processes that could be interrupted for sleep and which ones could not). In many ways this would not be trivial and all for the ability to leave the sleep function on all the time. For the few activities that someone does where they would not want sleep activating and they ALSO are not sitting at the console using it, just turning off sleep temporarily is so easy, it's unlikely that Apple could justify putting so much development effort into such a minor feature.

All this only IMHO, of course!

Jeff Wiseman
to reply, just remove ALLTHESPAM

Message #3 - Posted 2005/05/04 - Neill Massello

Karl Zag4n wrote:

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

In System preferences it is too limited for my taste. I think in Linux it has hdparms, but that doesn't seem to exist in os X. And the thing is it is a SCSI not IDE disk (which is connected via a SCSI card) which I want to control the spin down time on. Currently it spins down way too soon (about 10 minutes or so setting System Preferences>Energy Saver>Sleep>Put the hard disk(s) to sleep when possible

The time (in minutes) until hard disk sleep is stored in the /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist file. You can modify it with the defaults command, Property List Editor (/Developer/Applications/Utilities/Property List Editor.app), a text editor, or with one of the third-party configuration utilities such as TinkerTool System <http://www.bresink.com/osx/TinkerToolSys.html>.

Question 2:

Why the hell does OS X go to sleep when the computer is doing something ? OS 9 didn't do that.

I'm no developer so I'm just guessing, but this might have something to do with differences in multi-tasking between OS 9 and OS X.

Example leave bittorent downloading something overnight. Or doing a long 3d render overnight.

Wake up and find the computer is asleep on the job.

I know you can turn off sleep in Energy Saver, but it seems a huge flaw that OS X is apparently testing user input as a measure of inactivity, not CPU/disc/network use.

It is annoying, but I don't know whether the blame lies with Apple or with third-party developers. Sleep in OS X can be prevented by some processes, although not usually by design. On most Macs, at least some background processes (backup schedulers, etc) will be third-party stuff that Apple hasn't written. If those processes don't reset the sleep timer or tell the OS not to sleep -- if that's possible -- the OS has to presume that it's all right to put the Mac to sleep. Otherwise, few Macs would ever go to sleep on the timer.

Message #4 - Posted 2005/05/04 - Ernie Klein

Previously, Karl Zag4n wrote:

Hi,

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

You can adjust the spindown time from 1 minute to 1000 minutes by using the "SpindownHD" tool if you have the developer tools and CHUD tools installed.

-Ernie-

"There are only two kinds of computer users -- those who have suffered a catastrophic hard drive failure, and those who will."

Have you done your backup today?

Message #5 - Posted 2005/05/04 - Karl Zag4n

Hi,

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

In System preferences it is too limited for my taste. I think in Linux it has hdparms, but that doesn't seem to exist in os X. And the thing is it is a SCSI not IDE disk (which is connected via a SCSI card) which I want to control the spin down time on. Currently it spins down way too soon (about 10 minutes or so setting System Preferences>Energy Saver>Sleep>Put the hard disk(s) to sleep when possible

Question 2:

Why the hell does OS X go to sleep when the computer is doing something ? OS 9 didn't do that.

Example leave bittorent downloading something overnight.
Or doing a long 3d render overnight.

Wake up and find the computer is asleep on the job.

I know you can turn off sleep in Energy Saver, but it seems a huge flaw that OS X is apparently testing user input as a measure of inactivity, not CPU/disc/network use.

thanks

Message #6 - Posted 2005/05/04 - Karl Zag4n

Previously, Jeff Wiseman wrote:

<snip>

thanks for the comments, but this I don't agree with:

it's unlikely that Apple could
justify putting so much development effort into such a minor feature.

if (time>=sleeptime){
if (cpuload >idle) {
// dontsleep
} else {
sleep();
}
}

It would be trivial to develop and lot less ugly than having to manually disable sleep everytime you needed to.

Message #7 - Posted 2005/05/04 - Tom Stiller

Previously, Ernie Klein wrote:

Previously, Karl Zag4n wrote:

Hi,

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

You can adjust the spindown time from 1 minute to 1000 minutes by using the "SpindownHD" tool if you have the developer tools and CHUD tools installed.

Or with 'pmset'.

Tom Stiller

PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3
7BDA 71ED 6496 99C0 C7CF

Message #8 - Posted 2005/05/04 - Mark Haase

Previously, Karl Zag4n wrote:

It would be trivial to develop and lot less ugly than having to manually disable sleep everytime you needed to.

Hey Karl,

There are APIs for an application to prevent sleep, I just think most applications that should use them don't. Maybe you could write a shell script to toggle sleep on and off and drop it in the dock..

--

\/| /| |2 |<

mehaase(at)sas(dot)upenn(dot)edu

Message #9 - Posted 2005/05/05 - Jochem Huhmann

Karl Zag4n <nowhere@spamis.not> writes:

Hi,

Question 1: how do you set a hard disk spin down time manually in OS X (Panther)?

psmset spindown nn (where nn is the time in minutes). Read the pmset man-page for details.

Why the hell does OS X go to sleep when the computer is doing something ?

Because it is always doing something and there is no way to tell from within some code (and be it very clever code) if this is something that is important to you or not. The only clear thing to watch out for is user activity.

I know you can turn off sleep in Energy Saver, but it seems a huge flaw that OS X is apparently testing user input as a measure of inactivity, not CPU/disc/network use.

There's always some CPU/disc/network use. And there is no clean way to tell if this is caused by something that is important enough to the very user at that very point of time that it should not cause the machine to go to sleep. I think Apple did the right thing. If they had tried to be too clever with this you might have ended up with a more or less unreliable behaviour in this regard.

Jochem

"A designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away." - Antoine de Saint-Exupery

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.