From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25249 invoked by alias); 20 Jul 2012 16:20:11 -0000 Received: (qmail 25209 invoked by uid 22791); 20 Jul 2012 16:20:06 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx.meyering.net (HELO mx.meyering.net) (88.168.87.75) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 16:19:53 +0000 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id F3DE960BED; Fri, 20 Jul 2012 18:19:50 +0200 (CEST) From: Jim Meyering To: Jason Merrill Cc: overseers@gcc.gnu.org Subject: Re: Multiple cvs/git mirror tasks? In-Reply-To: <50045455.5090807@redhat.com> (Jason Merrill's message of "Mon, 16 Jul 2012 13:50:13 -0400") References: <50003CD7.8080401@redhat.com> <87bojjsm47.fsf@rho.meyering.net> <50045455.5090807@redhat.com> Date: Fri, 20 Jul 2012 16:20:00 -0000 Message-ID: <87pq7q8kwp.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact overseers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: overseers-owner@sourceware.org X-SW-Source: 2012-q3/txt/msg00029.txt.bz2 Jason Merrill wrote: > On 07/13/2012 11:43 AM, Jim Meyering wrote: >> Those jobs are supposed to be started by these crontab entries: >> >> 0-59/15 * * * * sh -c "nice $HOME/bin/mirror-sw lvm" >> 20-59/30 * * * * sh -c "nice $HOME/bin/mirror-sw binutils" >> 8-59/30 * * * * sh -c "nice $HOME/bin/mirror-sw gdb" >> 14 * * * * sh -c "nice $HOME/bin/mirror-sw newlib" > > It seems that when the machine is heavily loaded one of these jobs can > take more than the allotted time, which is why I was seeing three of > them (including two for gdb) running at the same time; it would > probably be good to use a mkdir mutex to make sure that you only have > one running at a time. Hi Jason, It is not uncommon (particularly after a tagging) for a gdb or binutils mirror-sw run to take much longer than the usual minute or two. When that happens or when the system is overloaded, you may see concurrent runs for two or more projects. However, that is not the norm. For example, I see that just as I started writing this, the gdb sync started [btw, it completed in under a minute]: meyering 7750 0.0 0.0 2720 904 ? SNs 15:38 0:00 /bin/sh /home/meyering/bin/mirror-sw gdb meyering 9407 0.0 0.0 2720 412 ? SN 15:38 0:00 /bin/sh /home/meyering/bin/mirror-sw gdb meyering 9408 0.0 0.0 2720 512 ? SN 15:38 0:00 /bin/sh /home/meyering/bin/mirror-sw gdb At first glance, you may think there are three invocations of the script, but as recently discussed here, that's merely due to a subshelled pipeline in the script: each element of the pipeline ends up looking (in ps output) like another invocation of the parent script. It really was invoked only once. I'm leery about adding naive cross-project locks, because that could let a busy project starve one that needs only a tiny update. Using lockfile(1) and a timeout might help. I could add a per-project locking mechanism to prevent e.g., two gdb syncs from running in parallel when the first one takes more than the 30m between cron invocations. That could save some system resources, but would not improve correctness or integrity. For starters, I've instrumented mirror-sw with code to record the duration of each run from now on. You can see some numbers already: sourceware$ tail ~meyering/log/* ==> /home/meyering/log/gdb <== 2012-07-20-16:10:00 5 ==> /home/meyering/log/lvm <== 2012-07-20-16:15:17 16 ==> /home/meyering/log/newlib <== 2012-07-20-16:14:28 27 Let's see if/when things overlap. Besides, I've heard there might be a hardware upgrade coming... That might make performance-related tweaks premature.