|
Home > Archive > Web Servers on Unix and Linux > May 2004 > updating web pages without downtime
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
updating web pages without downtime
|
|
|
|
I was just wondering how, on pages that get updated frequently, there
are never any 404 errors, or incomplete pages that are seen by the user?
It seems like in the split second it takes to change the page, there
would be problems with users downloading it. What is the process to
update a (frequently used) page with no downtime?
By the way, I use an apache server.
thanks,
-d
| |
| David Logan 2004-05-06, 10:52 am |
| Doug wrote:
>
>
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
>
>
> thanks,
> -d
>
Anything that is frequently updated is a CGI script, so the html is
dynamically generated every time a user loads a page. Thus no "page", as
it were, really exists.
I have never tried frequently rewriting an actual HTML page from
somewhere, since that is what CGI is all about.
David Logan
| |
| GreyWyvern 2004-05-06, 12:05 pm |
| On Thu, 06 May 2004 14:17:01 GMT, Doug <dougd99@earthlink.net> wrote:
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
In using my own server, when I've FTP uploaded something and, in error
because I'm impatient, hit reload on the browser before the upload in
complete, I just got half a page.
This is just one of the aspects of the web you have to live with unless
you have redundant servers and can switch routing at whim between them.
Grey
--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system
| |
| Gandalf Parker 2004-05-06, 12:05 pm |
| Doug <dougd99@earthlink.net> wrote in news:xNrmc.7080$a47.711
@newsread3.news.atl.earthlink.net:
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the
user?
Uploading by ftp could tie up a web page or a graphic though it seems a
small concern. Actions on the server itself is much faster.
I try not to upload to the pages that users see. Upload to another
directory then copy them into place. A move command is even quicker (but
I like the backup copy I have by not using it). And if you are really
worried then upload it to the location as a different name then rename
it.
send index.asc
mv index.asc index.html
Gandalf Parker
| |
| SpaceGirl 2004-05-06, 12:05 pm |
|
"Doug" <dougd99@earthlink.net> wrote in message
news:xNrmc.7080$a47.711@newsread3.news.atl.earthlink.net...
>
>
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
>
>
> thanks,
> -d
A lot of scripting languages, such as ASP, precompile the entire page into
memory before sending it out to the user. So, if a user "reads" an ASP file
as it is being written to, they will get the in-memory version, not the one
on disk. If they hit reload, they would get the new one on disk, but only if
it has been finished writing. This can be configured in the script itself,
or on the server.
| |
| Bill Logan 2004-05-06, 2:40 pm |
|
"Doug" <dougd99@earthlink.net> wrote in message
news:xNrmc.7080$a47.711@newsread3.news.atl.earthlink.net...
>
>
> I was just wondering how, on pages that get updated
frequently, there
> are never any 404 errors, or incomplete pages that are
seen by the user?
>
> It seems like in the split second it takes to change the
page, there
> would be problems with users downloading it. What is the
process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
>
Something others do not seem to have mentioned.
In many cases, when a page is requested the one the visitor
sees may not be the one on your site.
Most ISP's use caches to store recently requested pages so
the ones you are uploading may not even get requested while
uploading.
Dont know about windows but if you are on *nix then you need
to read up on how ftp works and how apache works also. A
visitor will either get a page - or they wont. If they only
get half a page then it will be to do with something
inbetween. A file can only have one operation at a time.
Written to or read. (It can have multiple readers at the
same time)
| |
| Andrzej Adam Filip 2004-05-06, 2:40 pm |
| Doug wrote:
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
1) upload new version of the_page.html as the_page.html.new
2) execute "mv -f the_page.html.new the_page.html"
mv delivers "atomic action" when both files are located in the same file
system.
A) Do you have shell access to the server ?
B) What methods are available to you for updating ?
[list constraints]
--
Andrzej [en:Andrew] Adam Filip anfi@priv.onet.pl anfi@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
The best portion of a good man's life, his little, nameless, unremembered acts
of kindness and love.
-- Wordsworth
| |
| Joshua Slive 2004-05-06, 3:40 pm |
| Doug <dougd99@earthlink.net> wrote in message news:<xNrmc.7080$a47.711@newsread3.news.atl.earthlink.net>...
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
You need to use a filesystem-atomic operation to update the file. I'm
not an expert in this, but it would go something like this:
Instead of
vi livefile.html
do
vi offline.html
mv offline.html livefile.html
Since the mv operation is atomic, there should be no affect on
clients.
Joshua.
| |
| Duende 2004-05-06, 4:41 pm |
| While sitting in a puddle Joshua Slive scribbled in the mud:
> Since the mv operation is atomic, there should be no affect on
> clients.
So you're the one with the WMD
--
Duende
| |
| J. A. Mc. 2004-05-06, 6:38 pm |
| On Thu, 06 May 2004 15:06:02 GMT, Gandalf Parker
<gandalf@most.of.my.favorite.sites> found these unused words floating about :
>Doug <dougd99@earthlink.net> wrote in news:xNrmc.7080$a47.711
>@newsread3.news.atl.earthlink.net:
>
>user?
>
>Uploading by ftp could tie up a web page or a graphic though it seems a
>small concern. Actions on the server itself is much faster.
>
>I try not to upload to the pages that users see. Upload to another
>directory then copy them into place. A move command is even quicker (but
>I like the backup copy I have by not using it). And if you are really
>worried then upload it to the location as a different name then rename
>it.
>send index.asc
>mv index.asc index.html
>
>Gandalf Parker
If you ftp all the images, etc. -then- ftp the html, there's little
probability of bumping the user. It's a matter of a very few seconds.
Pre-Testing on a unix simulator a your PC takes care of the 404's.
| |
| Saint Firk 2004-05-06, 7:37 pm |
| Way down deep in the middle of the congo, Doug and a hippo took an apricot a
guava and a mango. Stuck it with the others and he danced a dainty tango...
>
>
> I was just wondering how, on pages that get updated frequently, there
> are never any 404 errors, or incomplete pages that are seen by the user?
>
> It seems like in the split second it takes to change the page, there
> would be problems with users downloading it. What is the process to
> update a (frequently used) page with no downtime?
>
> By the way, I use an apache server.
D Y N A M I C
its more than a word... mofo.
--
Dale,
www.oxygenkiosk.net
Now playing: Morrissey - The World Is Full Of Crashing Bores
|
|
|
|
|