Multiple tinderd instances

Joe Marcus Clarke marcus at marcuscom.com
Fri Dec 5 20:08:33 EST 2008


On Fri, 2008-12-05 at 23:48 +0000, Tim Bishop wrote:
> [prompted by recent discussion I realised I never replied to this]
> 
> On Sun, Aug 03, 2008 at 08:35:05PM -0400, Joe Marcus Clarke wrote:
> > On Sat, 2008-08-02 at 02:48 +0100, Tim Bishop wrote:
> > > diff -ruN /usr/local/tinderbox/scripts/etc/rc.d/tinderd.sh scripts/etc/rc.d/tinderd.sh
> > > --- /usr/local/tinderbox/scripts/etc/rc.d/tinderd.sh	2008-01-17 12:31:39.000000000 +0000
> > > +++ scripts/etc/rc.d/tinderd.sh	2008-01-17 12:33:18.000000000 +0000
> > > @@ -24,6 +24,7 @@
> > >  : ${tinderd_enable="NO"}
> > >  : ${tinderd_directory="/space/scripts"}
> > >  : ${tinderd_flags=""}
> > > +: ${tinderd_instances="1"}
> > 
> > Do you have any rule of thumb on how to scale this?  That is, do you
> > have any documentation on how people could best use this feature?
> 
> Not really. I've been going for number of cpus/cores so far, but disk
> I/O is the real killer. It's certainly quicker than sequential builds,
> but not as fast as I'd hoped.
> 
> > > +		if mkdir /tmp/tinderdlock >/dev/null 2>&1; then
> > > +			${pb}/scripts/tc listBuildPortsQueue -s ENQUEUED -r > /tmp/tinderd.$$
> > > +			while read line; do
> > > +				BUILD=$(echo ${line} | cut -d: -f3)
> > > +				if [ ! -f $pb/builds/$BUILD/tinderdlock -a ! -f $pb/builds/$BUILD/lock ]; then
> > > +					touch $pb/builds/$BUILD/tinderdlock
> > > +					ENTRY=$line
> > > +					break
> > > +				fi
> > > +			done < /tmp/tinderd.$$
> > > +			rm /tmp/tinderd.$$
> > > +			rmdir /tmp/tinderdlock
> > > +		fi
> > > +
> > 
> > Why roll your own locking?  Why not use lockf?
> 
> Naivety? Yes, lockf would be better.
> 
> > What happens if tinderd gets killed after it's created
> > /tmp/tinderdlock, but before it's removed it?
> 
> Breakage. It could be fixed with a trap I suppose.
> 
> This is one of those rough round the edges ideas that mostly works for
> me, but that I'd not be happy including in tinderbox as is. I sent it
> along in the hope that it might be useful or provide ideas for others.

If you do smooth out those edges, I would be willing to add this to the
distribution.

Joe

-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://marcuscom.com/pipermail/tinderbox-list/attachments/20081205/015bbe0f/attachment.bin>


More information about the tinderbox-list mailing list