Skip to main content.
home | support | download

Back to List Archive

Re: Limiting load?

From: J Robinson <jrobinson852(at)>
Date: Thu Oct 02 2003 - 14:53:56 GMT
Hello Bill and Everyone:

Sometimes I really want to keep a machine's load under
1.0. And yes, the only (portable?) way to really lower
the load while running swish-e when it's already niced
is to have it sleep.

I spent some time and patched PR3 to perform a
gnumake-like max load feature-- while indexing, if the
load goes above a configured value, swish-e sleeps for
a configurable amount of time (3 seconds by default),
then continues.  This changed required modifying about
400 lines in 7 files in src, adding getloadavg() (from
gnu make-- the implementation seems super-portable),
and little more.

I'd like to submit this patch for consideration in the
PR4 release. What's the best way to submit it?

Thanks and best,

--- Bill Moseley <> wrote:
> On Mon, Sep 29, 2003 at 10:15:09AM -0700, J Robinson
> wrote:
> > Sometimes I like to ensure I let most of a
> machine's
> > CPU and disk remain free for other tasks. 
> > 
> > I was thinking there might be some CPU-quota like
> > mechanism I could apply to the swish-e program
> while
> > it was indexing -- again, past nice-ing the
> process. 
> I would think nice would be what you want if the
> goal is to save the CPU 
> for more important tasks and let swish-e have the
> free CPU cycles.
> > Alternately, is there interest in a '--maxload'
> patch
> > for swish-e?
> It would not be portable, I fear.
> I don't know much about this kind of process
> management, so I'm not sure
> how best to implement such a thing.  Feel free to
> correct my 
> misunderstandings.
> Load is the number of processes ready to run, right?
>  So once swish-e is
> running you can't really reduce the load without
> making swish-e sleep
> (or otherwise make it non-runable), since you can't
> change the number of
> swish-e processes.  You can make it sleep, but that
> doesn't seem very
> efficient use of the CPU.  
> moseley@mardy:~$ nice -n 19 swish-e -i usrdocs -c c
> -e
> Elapsed time: 00:01:09 CPU time: 00:00:55
> moseley@mardy:~$ nice -n 0 swish-e -i usrdocs -c c
> -e
> Elapsed time: 00:01:08 CPU time: 00:00:54
> You want a load level of one (or close to one), I
> believe, otherwise the
> CPU is idle, and you didn't buy that CPU for it to
> be sitting around not
> working.  Even with swish-e reniced swish will still
> run if there's cpu
> available.
> How about writing a script that watches the load
> average and if it gets
> above some number then renice swish-e.  If you have
> plenty of CPU you
> still may still get in a situation of being disk
> bound and making other
> applications also wait for the disk.
> -- 
> Bill Moseley

Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Received on Thu Oct 2 14:54:04 2003