Let's say that I'm running Nginx as my webserver. I know that Nginx handles the
-s reload command which will reload the configuration when it's changed, but waits around for current requests to finish before it cycles the worker processes to use the new config, so hooray, no downtime!
But what about changing actual files?
For instance, let's say that I've got an
index.html and I've realized there's a typo in my page. Let's also say that it's a highly active page (like StackOverflow, for example) and I want to fix my typo.
If I just go edit the file with a text editor, or update it with
scp or something, is it possible for a request to get fouled up?
For instance, say I'm running on a multicore machine and the request comes in from the client through Nginx to load up
index.html, and at the very same time data starts coming in from me to update
Is there any kind of circumstance where the client would only get a partially finished file? Or a file that contains old data that was on the disk in the location of that new file?
Or are there some sorts of guarantee around that not happening. I understand the probability of such events actually happening are pretty slim, but what's the simplest method that guarantees both uptime and accessing only the correct files?