Re: mod_cache: will a Thundering Herd be caused by reading cached files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 14, 2011 at 2:42 PM, Rex Young <rex.young@xxxxxxxxxx> wrote:
> Hi guys,
>
> I just read about mod_cache and Thundering Herd at
> http://httpd.apache.org/docs/2.2/mod/mod_cache.html
>
> It describes a case of Thundering Herd which may happen when a cached file
> is being updated.  I was wondering why it does not mention another possible
> Thundering Herd caused by reading a cached file.  In latter case, when
> Apache is serving a request by reading a cached file, it may last for a big
> amount of time.  Because the client that requests the cached file may be
> very slow, or the file may be very large in size.
>
> While serving such a request, other requests may arrived and found that the
> cached file is stale and needs to be updated.  But at the same time, the
> Apache has to wait until the read operation to finish.  Because on some OSes
> e.g. Windows you can not delete/replace a file when it is open.
>
> If you know details how Apache handles the situation, could you please share
> it with me? Thank you.

The slow client using mod_disk_cache would have the file open the
entire time, and it doesn't matter if someone else unlinks it or
replaces it (replace the file, not the contents)  Another thread, the
one who discovers the resoure is now stale, can unlink it and start
streaming the updated file to a scratch directory.  When it's
complete, he puts it in its final location.

Outside of windows, as long as someone has a file open, unlinking it
in the filesystem only affects people who try to open the file later.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux