Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 88270 invoked from network); 24 Feb 2010 01:06:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 01:06:31 -0000 Received: (qmail 60694 invoked by uid 500); 24 Feb 2010 01:06:30 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 60607 invoked by uid 500); 24 Feb 2010 01:06:30 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 60594 invoked by uid 99); 24 Feb 2010 01:06:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 01:06:30 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.61.9.20] (HELO mail1.nl.clara.net) (212.61.9.20) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 01:06:20 +0000 Received: from claranet.nl (bifur.vianetworks.nl [212.61.15.16]) by mail1.nl.clara.net (Postfix) with SMTP id F1188358CE9; Wed, 24 Feb 2010 02:05:59 +0100 (CET) Received: from 82.73.244.17 (SquirrelMail authenticated user buyway58) by webmail.claranet.nl with HTTP; Wed, 24 Feb 2010 02:06:00 +0100 (CET) Message-ID: <60768.82.73.244.17.1266973560.squirrel@webmail.claranet.nl> Date: Wed, 24 Feb 2010 02:06:00 +0100 (CET) Subject: Re: Rename a database? From: "Markus Jelsma" To: In-Reply-To: <-8416322577953296462@unknownmsgid> References: <21a5a18d1002231104h75eee414gf6bcf6e03a6d3403@mail.gmail.com> ,<-683182627280217118@unknownmsgid> <-8416322577953296462@unknownmsgid> X-Priority: 3 Importance: Normal Cc: Reply-To: markus@buyways.nl X-Mailer: SquirrelMail (version 1.2.8) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Size does matter and it is certainly not just bound only by the speed of the harddrive. I've just created a 0.9GB database with about 300.000 documents. It takes quite a while for it to replicate locally, it took 3m20s while copying a 2GB file takes less than 30s (on the same disk). CouchDB, of course, does a lot of work for replication such as reading, checking for conflicts and appending. A 12GB file will certainly take a long time on a system like this machine although it has lots of RAM, fast CPU and relatively fast disks. There is, however, a trick you might consider. But you may be asking for trouble on this one, so be careful. On Unix you can simply move (rename) a file while the readers are unaffected. Since CouchDB keeps the files open there _shouldn't_ be a problem. But keep in mind, writes to the old file (db name) will not show up in the newly move file, it will also not trigger an error (tested and confirmed here with a 10MB database). I am not sure why writes fail but don't trigger an error, perhaps i haven't given it enough though at this moment. Please, don't execute the things above without verification. Test it yourself with a reasonable comparable database and hopefully get some additional feedback in this method from CouchDB developers. Although i have executed this (even multiple times) in this test set up, and verified it works without a single problem, it doesn't proof it's actually a good practice. Sean Hess said: > The databases total to about 12 GB before any views are generated. How > long would it take to replicate that if it was local? Would it be > bound only by the harddrive speed? > > On Feb 23, 2010, at 4:07 PM, Nils Breunese wrote: > >> In my experience replication is nearly instantaneous, especially since >> in this case it's to the local machine. But I don't know how large >> your databases are. >> >> You could even run the import on another machine and replicate the >> resulting database to the production machine afterwards to offload the >> production server from the import load. You could even replicate it to >> a separate database the production machine afterwards and the >> replicate to the 'real' live database if the difference in downtime >> due to network latency is significant enough. >> >> Nils. >> ________________________________________ >> Van: Sean Hess [seanhess@gmail.com] >> Verzonden: dinsdag 23 februari 2010 23:49 >> Aan: user@couchdb.apache.org >> Onderwerp: Re: Rename a database? >> >> I need the system to stay live the whole time, so the rename has to be >> nearly instantaneous. I do wish there was an http way to do it though. >> >> De informatie vervat in deze e-mail en meegezonden bijlagen is >> uitsluitend bedoeld voor gebruik door de geadresseerde en kan >> vertrouwelijke informatie bevatten. Openbaarmaking, >> vermenigvuldiging, verspreiding en/of verstrekking van deze >> informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat >> niet in voor de juiste en volledige overbrenging van de inhoud van een >> verzonden e-mail, noch voor tijdige ontvangst daarvan.