httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: [users@httpd] Frequently updating static content
Date Thu, 21 Jan 2016 00:55:32 GMT
On Wed, Jan 20, 2016 at 9:36 PM, David Rush <david.rush@wyo.gov> wrote:
> I'm using Apache 2.4 (on Linux) to serve some static files that are
> re-created and re-written every two minutes.  The nature of our site is that
> we get hammered with high request rates from time to time (thousands of
> requests per minute at times).
>
> Are there any issues with frequently updating a file that's being served?

Not that I'm aware of.

> What happens if it's updated (re-created) at the same instant that it's
> being requested?

This should be handled carefuly, the updater and the server should not
race on the content of the file but on the file (inode) itself.

You could first create the new file with an extension (e.g. ".tmp")
and then rename it to the served file using "mv -f servedfile.tmp
servedfile", which is usually atomic on Unixes (at least Linux and
BSDs afaict).

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message