Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2010 23:54:59 +0000
From:      Adrian Wontroba <aw1@stade.co.uk>
To:        freebsd-stable@freebsd.org
Subject:   Re: immense delayed write to file system (ZFS and UFS2), performance issues
Message-ID:  <20100126235458.GA12634@swelter.hanley.stade.co.uk>
In-Reply-To: <cf9b1ee01001261515n72f32265tf8dd0da5c8a3ec3c@mail.gmail.com>
References:  <cf9b1ee01001261515n72f32265tf8dd0da5c8a3ec3c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 27, 2010 at 01:15:17AM +0200, Dan Naumov wrote:
> Can anyone confirm that using the WDIDLE3 utility on the 2TB WD20EADS
> discs will not cause any issues if these disks are part of a ZFS
> mirror pool? I do have backups of data, but I would rather not spend
> the time rebuilding the entire system and restoring enormous amounts
> of data over a 100mbit network unless I absolutely have to :)

How about using the "write every 5 seconds" python script posted earlier
in this thread by erik@tefre.com? Works nicely for me and stops the load
cycle count increase.

Thank you Erik!

To save searching, here is Erik's script as used here.

#!/usr/local/bin/python
# Author: Erik Stian Tefre <erik@tefre.com>
#Keeping this python script running prevents Load_Cycle_Count from
#incrementing on my WD15EADS drives by forcing a write every 5 seconds (2
#drive zfs mirror pool, average of 2 load cycles per minute when the
#script is not running):

import time,os

mypool = "/tank"
#         ^^ Change to your pool!

fname = os.path.join(mypool, "wd_green_anti_idle.pyfile")
c = 0
f = open(fname, "w")

while True:
        if c == 100:
                f.close()
                f = open(fname, "w")
                c = 0
        c += 1
        time.sleep(5)
        f.write("a")
        f.flush()
        os.fsync(f.fileno())

You might find this handy too:

#!/bin/sh
# $FreeBSD:$

# PROVIDE: wd_green_anti_idle
# REQUIRE: LOGIN

. /etc/rc.subr

wd_green_anti_idle_enable="${wd_green_anti_idle_enable-NO}"

name=wd_green_anti_idle
rcvar=`set_rcvar`
command="/usr/local/stade/bin/wd_green_anti_idle.py"
start_cmd="wd_green_anti_idle_start"

wd_green_anti_idle_start()
{
    if ! checkyesno wd_green_anti_idle_enable ; then
	return 0
    fi
    echo "Starting ${name}."
    ${command} &
}

load_rc_config $name
run_rc_command $*

Adjust command name to suit, put in /usr/local/etc/rc.d, add
wd_green_anti_idle_enable="YES" to /etc/rc.conf and the script starts
running during startup. A minor bug - it doesn't close down.

-- 
Adrian Wontroba
A witty saying proves nothing, but saying something pointless gets
people's attention.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100126235458.GA12634>