[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modgzip
Subject:    [Mod_gzip] On-disk temp files, speed, memory, and paging.
From:       Brandon <brandon () voltaire ! voyager ! com>
Date:       2001-04-20 4:55:24
[Download RAW message or body]

Please see the very bottom of this message for a separate
performance tip regarding disk access -- it does not pertain
directly to the rest of this message.

We've found our system with mod_gzip actually runs faster when using
temp files on disk than using the inmem option.  This is particular
to our system setup, but I'm including it because others may run
into the same issue.

Linux systems tend to use free ram for disk buffers.  On a system like
ours we have a huge amount of varying disk data loaded, so the buffers
quickly consume a large amount of ram.

Our system seems to operate very quickly when apache is first started,
handling the heavy load and serving hits nicely until free shows
the free memory drops down (cached value goes up).  I believe this
linux must transfer memory for cache for use by processes allocating
ram.  This seems to cause more disk access (I guess because the
cache buffers are full and thus more disk access for both read and
writes).

Anyhow, because the memory is used by disk cache, it seems faster to
leave mod_gzip with a very low max inmem setting, thereby letting
caching handle the burden, whereby the alternative is for linux to
free up cache and provide that ram to malloc() calls.

I'm not sure if all the reasoning is right, but our tests still seem
to show, on our particular linux server, disk access, and volume of
requests (about 13 accesses/second, 19/second at peak), that it is
faster with very low to no mod_gzip_maximum_inmem_size.

A VERY IMPORTANT PERFORMANCE TIP:
This regards unix file-systems, especially ext2fs, which updates
the "atime" of a file when the file is accessed, even if the file
is accessed read-only!  The atime of a file is very rarely used.

Any files, logs, programs, etc. require a write to the filesystem
on any access to the file.  This can be disabled in one of two
ways.  The "chattr +A" command can be used on any file(s) in an
ext2fs system to prevent the updating of the atime.  You can use
chattr -R +A to recurse.  Alternatively, you can apparently mount
an entire partition with the "noatime" option.

This seems to decrease filesystem activity immensely.

Sincerely,
Brandon

|~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~|
|  Brandon Hechinger                  Ideas, Programming, & Design  |
|  Voyager Info-Systems                   brandon@mail.voyager.com  |
`-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-._.-~-'

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic