Skip to main content.
home | support | download

Back to List Archive

Re: Swapping indexes

From: Mike Kralec <mkralec(at)not-real.sbgnet.com>
Date: Fri Dec 03 2004 - 19:37:08 GMT
If you're running on unix, I know this: a copy takes a (relatively) long 
time, but a move is very quick if you aren't moving it to a different 
partition, so you could theoretically copy it to a different file name, 
i.e. index-new then do a move which will take very little time compared 
to the copy.
On a 2GB index file:

[root@newsarchive setup]# time cp avid.index avid.index.new

real    2m29.973s
user    0m0.230s
sys     0m20.480s
[root@newsarchive setup]# time mv avid.index.new avid.index.newer

real    0m0.002s
user    0m0.010s
sys     0m0.000s
[root@newsarchive setup]#

BTW, I have no idea if it works this way on Windows.
Mike

Brad Miele wrote:

>I am looking for a good solution for swapping indexes on my webservers.
>
>Currently, i rsync 4 1+ Gig indexes(and prop files) to a temporary area,
>then I run a script which tests each index, and as long as there is no
>error, it copies it to the live index directory, and then it restarts the
>webserver. The problem is that while the index is being copied to live,
>searches start to hang, and i get some huge http processes.
>
>I can stop the webserver before each copy, but i am really looking for a
>less harsh mechanism.
>
>Brad
>------------------------------------------------------------
> Brad Miele
> Technology Director
> IPNStock
> (866) 476-7862 x902
> bmiele@ipnstock.com
>
> Iron Law of Distribution:
>	Them that has, gets.
>
>  
>
Received on Fri Dec 3 11:37:08 2004