[PLUG] nice process

Steve Bonds 1s7k8uhcd001 at sneakemail.com
Tue Nov 12 19:11:07 UTC 2002


On Tue, 12 Nov 2002, Mike De La Mater mikedela-at-ipns.com |PDX Linux| wrote:

> I'm using flexbackup to do web server backups. Today while I was
> watching 'top' I was stunned at how much system resources that gzip
> took.
> 
> How do I renice this? I don;t really care how fast gzip is, but I want
> the server to be more avail to apache.

Generally gzip is CPU-bound.  The default UNIX scheduler does a pretty
decent job of transparently managing CPU-bound processes with a minimum of
impact on a system.  (The same cannot always be said of I/O or
memory-intensive jobs...)

> Can I default renice gzip or something to fix this? Will gzip be
> reniced if I launch it with a reniced flexbackup?

If gzip is forked by flexbackup it should be also niced if the original
flexbackup is started using the "nice <command>" command.  If you just
renice the flexbackup process that's already running then no, the gzips
won't change.

> I'm not sure I know what I want, except that I need gzip to be more
> polite.

If you can change the invocation of gzip that flexbackup uses, try using
"nice gzip --fast" instead.  This runs it at reduced priority and uses a
slightly less tight compression.

In my tests on the same data set gzip (default) compressed a set of files
to 20% of their original size and "gzip --fast" compressed the same set to
25% of their original size, but completed in less than half the time.

If you really want to get serious, you might also look at
"lzop" compression.  This is NOT gzip-compatible so if you plan to read
tapes far into the future or on systems without lzop you should not use
it.  It compressed that same data set as above to 30% of its original
size, but was 7 times faster than gzip!

  -- Steve





More information about the PLUG mailing list