Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AC9379FB694 for ; Fri, 16 Mar 2007 15:28:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 35297-04 for ; Fri, 16 Mar 2007 15:28:04 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 474A69FB68A for ; Fri, 16 Mar 2007 15:28:04 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.8/8.13.8) with ESMTP id l2GIS3bv035486 for ; Fri, 16 Mar 2007 15:28:03 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.8/8.13.8/Submit) id l2GI42rF032294 for pgsql-admin@postgresql.org; Fri, 16 Mar 2007 15:04:02 -0300 (ADT) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.admin Subject: Re: Slony sync times Date: Fri, 16 Mar 2007 13:10:27 -0400 Organization: cbbrowne Computing Inc Lines: 54 Message-ID: <60hcslm7wc.fsf@dba2.int.libertyrms.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.19 (linux) Cancel-Lock: sha1:ONGiQOpsE7pO91m5ESKlSs2cI2w= To: pgsql-admin@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/110 X-Sequence-Number: 24934 Zoomby Woof writes: > I'm using slony1 version 1.2.1 and I'm trying to figure out what the > actual default of the 'sync_interval' parameter is. The manual says > 100 ms in one place, and 10 seconds on another...some other places on > the net says 60 seconds, I have even seen 2 seconds being mentioned as > the default value for this parameter. My gut feeling is that it is 100 > ms, I haven't set this value explicitly, and stuff seems to replicate > pretty quick so...I haven't made any scientific tests on this though. > > Anyone knows the truth ? > > Also, are there any other dangers in lowering this number to say, 50 > ms, or even 10 ms, except the fact that the machine will be more > loaded ? We have an application where we loadbalance stuff and > occasionally we run into sync problem (the subscriber havent been > updated fast enough) There are two "sync parameters": - sync_interval - sync_interval_timeout The first one represents how often the slon will consider generating a SYNC event. In confoptions.c/confoptions.h (it moved from .h to .c in version 1.2), the default value is 2000ms. The second one represents how often a SYNC will get generated anyways, even if there are no updates taking place that would cause it to decide to generate a SYNC. The default is 2 minutes, which seems pretty reasonable. The event loop will wake up every (sync_interval) ms, and check to see if there has been any data collected to replicate. If so, it will generate a SYNC, and thus allow other nodes to start pulling data. If not, then it'll go back to sleep. If it reaches the sync_interval_timeout time without having yet generated a SYNC, it will do a SYNC even though there have been no changes, so that the systems can be aware that they're at least *trying* to replicate, even though your application isn't giving Slony-I any work to do. Dropping sync_interval to 100ms will mean it generates 20x as many SYNCs (increasing the workload, a cost...), and that it can consider replicating data 1/20th as soon (a benefit). That may very well be a good trade-off for you. I'd be surprised if dropping the time to 10ms gave a material further improvement; I'd think that would add more work than benefit. But you can feel free to prefer otherwise, and you won't be wrong, by your metrics. -- "cbbrowne","@","linuxdatabases.info" http://www3.sympatico.ca/cbbrowne/multiplexor.html Rules of the Evil Overlord #206. "When my Legions of Terror park their vehicle to do reconnaissance on foot, they will be instructed to employ The Club."