On Mon, Sep 19, 2011 at 11:51:51PM +0700, Victor Sudakov wrote:
> Valentin Nechayev wrote:
> >
> > > А мне удивительно, что она вообще тормозит при записи. Пусть бы
> > > писалось медленно, но почему другим процессам плохеет? Чай не в PIO
> > > моде работаем.
> >
> > Запусти впараллель всякие top и iostat и посмотри, какой показатель
> > выпирает.
> > Тогда можно будет что-то понять.
> > А так - всегда есть много методов испортить работу...
>
> top выглядит так (при этом тормоза ощутимые)
>
>
> last pid: 39657; load averages: 0.00, 0.00, 0.00 up 57+11:09:34
> 23:43:28
> 198 processes: 1 running, 195 sleeping, 2 zombie
> CPU: 0.0% user, 0.0% nice, 3.2% system, 0.4% interrupt, 96.4% idle
> Mem: 182M Active, 539M Inact, 196M Wired, 39M Cache, 108M Buf, 4496K Free
> Swap: 500M Total, 1212K Used, 499M Free
>
> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU
> COMMAND
> 39645 sudakov 1 45 0 5336K 1980K wdrain 0 0:03 2.69% dd
> 43092 squid 1 76 0 5504K 2316K wait 1 0:00 0.10% squid
> 43094 squid 1 44 0 45440K 39776K kqread 0 94:08 0.00% squid
> 913 root 10 44 0 3288K 1116K rpcsvc 1 69:54 0.00% nfsd
> 766 bind 5 44 0 54428K 43044K kqread 0 64:11 0.00% named
> 794 root 1 44 0 4344K 2352K select 1 19:57 0.00% ypserv
>
> А в iostat что именно смотреть?
>
> ЗЫ есть какие-то сходные жалобы
> http://freebsd.monkey.org/freebsd-current/200509/msg00099.html
> только у меня не RAID1, а RAID5.
/*
* waitrunningbufspace()
*
* runningbufspace is a measure of the amount of I/O currently
* running. This routine is used in async-write situations to
* prevent creating huge backups of pending writes to a device.
* Only asynchronous writes are governed by this function.
*
* Reads will adjust runningbufspace, but will not block based on
it.
* The read load has a side effect of reducing the allowed write
load.
*
* This does NOT turn an async write into a sync write. It waits
* for earlier writes to complete and generally returns before
* the
* caller's write has reached the device.
*/
void
waitrunningbufspace(void)
{
mtx_lock(&rbreqlock);
while (runningbufspace > hirunningspace) {
++runningbufreq;
msleep(&runningbufreq, &rbreqlock, PVM, "wdrain", 0);
}
mtx_unlock(&rbreqlock);
}