HD spin down and sleepy mac

Discussion in 'Apple' started by Karl Zag4n, May 4, 2005.

  1. Karl Zag4n

    Karl Zag4n Guest

    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
     
    Karl Zag4n, May 4, 2005
    #1
    1. Advertisements

  2. Karl Zag4n

    Jeff Wiseman Guest


    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, May 4, 2005
    #2
    1. Advertisements

  3. 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
    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.

    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.
     
    Neill Massello, May 4, 2005
    #3
  4. Karl Zag4n

    Ernie Klein Guest

    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?
     
    Ernie Klein, May 4, 2005
    #4
  5. Karl Zag4n

    Karl Zag4n Guest

    <snip>

    thanks for the comments, but this I don't agree with:
    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.
     
    Karl Zag4n, May 5, 2005
    #5
  6. Karl Zag4n

    Tom Stiller Guest

    Or with 'pmset'.
     
    Tom Stiller, May 5, 2005
    #6
  7. Karl Zag4n

    Mark Haase Guest

    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..
     
    Mark Haase, May 5, 2005
    #7
  8. psmset spindown nn (where nn is the time in minutes). Read the pmset
    man-page for details.
    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.
    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
     
    Jochem Huhmann, May 5, 2005
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.