From owner-freebsd-questions@FreeBSD.ORG Sat Nov 14 03:50:25 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E476106566B for ; Sat, 14 Nov 2009 03:50:25 +0000 (UTC) (envelope-from anti_spam256@yahoo.ca) Received: from web65503.mail.ac4.yahoo.com (web65503.mail.ac4.yahoo.com [76.13.9.47]) by mx1.freebsd.org (Postfix) with SMTP id B9E758FC0C for ; Sat, 14 Nov 2009 03:50:24 +0000 (UTC) Received: (qmail 21980 invoked by uid 60001); 14 Nov 2009 03:50:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1258170623; bh=kwJuuUIqtDEpv+2dDG3/D06rkhCuCuZ5XZm+V0RKJmA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=4MfaJBWpeCZVYqJgS8m3wRCTXS4jfKkE6tjD2rCIsOASR6ham8i81N+ev/66wKuECB+4+xeLqrsRPmxLnsC3HvPghvcgpC8yyl2onKb2IiQmYA19hlM8eITtMaDDgkVOCfucIsHWM5xJjZtLyHeCQ62nZYhQmRtHPZ718fyMedA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.ca; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tGgBLf8zBHSg+pmyJvwswdJhiBwBsw+E5OQ9qIVgtB8s7W1G/9Em1wPnfgsxtWNjyAwU1/j2D2KQJ9tG9SSDxRL9Zav55C45WDXVLw4zwd8/0hySHw29xwJYoXmQzxtZOG6axeppVNbIlSwCVLPT2liC4YrwLSWRvoaWLRFjdnc=; Message-ID: <695093.21975.qm@web65503.mail.ac4.yahoo.com> X-YMail-OSG: tgtt2hoVM1nfIyHYGHk8e7_hUe6CFT0vA.3ieTtKHkjvlv8vrZmnuT_JrTZwQY_5oPCFHkjB6XUAS9NAWN9597YR5xJNDDpwpuVhXwrT96lCngzEQ.c5gsawsZGxM5t0_wp_P6UUPuJ_l5fTVQmk9e1l5mON1DMIMijfvMUt2o5eOBTkpYY3HCbxjrLuxotyWqwc42BWfMSy1aRSrBd0mPwN_FPaOlojhbayChyLphd_BCrs_8enLMz8G0bVGXtHLDOOyxwxlf3w4ZRn9KBd_k9l_D9RtePLvcR9P8ahKCTS8Jbc9fzl4dJJCL6oak4xC8Vz5ErYHcGE88bkWsC_GtG8_FO97v0RQ6ig5_CfdoV.MNmE6Fku8OE5xUdIc6._OwpPukM3QXMVwHgruR5xZt8ZtUkgdWyFZCwOeXEhKq_x_eQMuGAqUD9ihEfMit5ZrCHHnstiA8X1xgAeikqR0xX.Unf73rDYRYD1mcyCYU0ekTcFz6AMlYakzMl9DwCq6GtRm_coZuE.FMIGlQobuzfb.A6eMXevs_Yrk._eh4nr1jDmoZfh2im.YIDc Received: from [208.99.137.71] by web65503.mail.ac4.yahoo.com via HTTP; Fri, 13 Nov 2009 19:50:23 PST X-Mailer: YahooMailClassic/8.1.6 YahooMailWebService/0.7.361.4 Date: Fri, 13 Nov 2009 19:50:23 -0800 (PST) From: James Phillips To: Chuck Swiger , David Allen In-Reply-To: <2daa8b4e0911131642p4d5935d1vff9cac77a43610ea@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: APM X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2009 03:50:25 -0000 I was going to just respond to myself again, but I see I generated some dis= cussion :)=0A=0AAnyway, In the =0Ahttp://forums.freebsd.org/showthread.php?= t=3D1012=0A=0Apage at least two people mentioned the ATAidle utility. It is= not recommended for the same reason APM isn't: devices sleep without OS co= nsent.=0A=0AAnyway, I now know the drive saves 5W spun down because this co= mmand has immediate effect:=0A# ataidle -o /dev/ad4=0AFollowed shortly by:= =0ANov 13 16:51:11 dusty kernel: ad4: TIMEOUT-WRITE=3DDMA retrying (1 retry= left) LBA=3D23261855=0A=0AI settled on (But using the rc.conf format):=0Aa= taidle -I 6 -S 10 /dev/ad4=0Abecause I think the "Idle timer" (minutes) and= "Supsend timer" (minutes) stack to 16 minutes. Setting the suspend time ha= s an effect of immediately spinning down the disk though (mentioned in the = man page)=0A=0ANo logging means I have to figure out how often the drive sp= ins up/down using other means. (I don't think the wake from idle (disk seem= s to keep spinning) or suspend triggers a message.)=0A=0AChuck wrote:=0A":Y= ou might also want to note that 2.5" laptop drives are/should be explicitl= y designed to spin down and park themselves much more often than generic ID= E drives are; some generic desktop drives will fail quite rapidly (ie, in a= matter of months) if you attempt to spin them down many times a day.:"=0A= =0AI suspect they are rated for a set number of power-on cycles. If (say) 5= shutdowns/day kills the drive in months, it must be rated for something li= ke 1000. (hmm, I should look it up.)=0A=0AIdeally, I want 1-5 shutdowns a d= ay, depending on use. I know for a fact I want the drives shutdown when the= server is "idling" for hours at a time. When set for a 15 minute time out = (with atacontrol), the drive was not getting spurious shut-downs.=0A=0A--- = On Fri, 11/13/09, David Allen wrote:=0A=0A= > =0A> > % grep diskless /etc/rc=0A> > dlv=3D`/sbin/sysctl -n vfs.nfs.diskl= ess_valid 2>=0A> /dev/null`=0A> > if [ ${dlv:=3D0} -ne 0 -o -f /etc/diskles= s ]; then=0A> > =A0=A0=A0 sh /etc/rc.initdiskless=0A> > # Run these after d= etermining whether we are booting=0A> diskless in order=0A> > # to minimize= the number of files that are needed on a=0A> diskless system,=0A> =0A> The= answer finally appears!=0A> =0A> A note to the OP.=A0 The only way I've fo= und to keep a=0A> disk spun down=0A> under FreeBSD is using memory devices = for both /var and=0A> /tmp.=0A> Disabling syslogd isn't enough, nor is modi= fying=0A> /etc/crontab, root's=0A> crontab (or even disabling cron) to limi= t disk=0A> access.=A0 But to use=0A> memory devices and have a "normal" sys= tem, you'll need to=0A> re-populate=0A> both /var and /tmp at startup.=A0= =A0=A0Which, it=0A> turns out, means starting=0A> with /etc/diskless.=0A=0A= I think I thought of that (putting /var/log in RAM) on my own: it does not = really fit what my server does though: it is a file server.=0A=0AI have abo= ut 5-6GB set aside (big enough to hold a DVD image) for /var and /tmp, and = only 256MB of memory. Backing the ramdisk with swap defeats the purpose.=0A= =0AChuck wrote:=0A"rsync -a /var_template /var"=0AThat is only half the bat= tle: you need a way to flush it to disk when it actually spins up; else ris= k loosing log data (In the event of power/hardware failure).=0A=0AI suppose= a cron job backing up periodic filesytem snapshots is possible, but you wo= uld have to trigger on the number of interrupts seen by the disk or somethi= ng to avoid waking it. I was thinking /proc/interrupts , but that is a Linu= x feature :P=0A=0ADo the messages from spinning the disk back up (with atac= ontrol) have any hooks? I suppose if you are desperate, you can (tail+) gre= p /var/log/messages. =0A=0A> Someone should add a section named=A0 "Non-Dis= kless=0A> Diskless Operation"=0A> to the Handbook.=0A=0AI like to think wha= t I am doing (with 10 year old hardware) is "cutting edge research." That i= s to say, the normal mode of operation for servers is to hold your nose and= let them run 24/7. It is more reliable that way.=0A=0AThe current trend fo= r mitigating that waste of energy is consolidation. If you can put a dozen = servers in one box, hopefully only 1 or 2 will be active at once.=0A=0AHowe= ver, I think drivers and hardware (like NICs with WOL) may have matured to = the point that it is possible to run "non-critical" servers (and desktops) = in such a way that they only turn on when needed. Suspend mode for the newe= r desktops here draw only ~3watts: comparable to the power-off (soft-off) s= tate.=0A=0A=0A> Thanks again for all the help!=0A> =0A=0A=0A _________= _________________________________________________________=0AMake your brows= ing faster, safer, and easier with the new Internet Explorer=AE 8. Optimize= d for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internet= explorer/