Your logic is flawed. If you pick worker A because its queue is tied for the 
shortest, then the other workers now have shorter queues. If you are trying for 
maximum throughput, you might be better off with multiple  workers serving a 
single queue.

Regards, 
Richard Schuh 

 

> -----Original Message-----
> From: CMSTSO Pipelines Discussion List 
> [mailto:cms-pipeli...@vm.marist.edu] On Behalf Of Bob Cronin
> Sent: Tuesday, January 04, 2011 5:34 PM
> To: CMS-PIPELINES@VM.MARIST.EDU
> Subject: Re: Pick a record at random?
> 
> Uh, because if I choose the same worker every time and it 
> does not process its spool files faster than they're arriving 
> (common), it will quickly get overloaded. I want to spread 
> the load evenly across the "n" workers.
> --
> bc
> 
> On Tue, Jan 4, 2011 at 5:28 PM, Schuh, Richard 
> <rsc...@visa.com> wrote:
> 
> > What difference does it make? You gain nothing by choosing a random 
> > worker except for complicating the process.
> >
> > Regards,
> > Richard Schuh
> >
> >
> >
> > > -----Original Message-----
> > > From: CMSTSO Pipelines Discussion List 
> > > [mailto:cms-pipeli...@vm.marist.edu] On Behalf Of Bob Cronin
> > > Sent: Tuesday, January 04, 2011 2:07 PM
> > > To: CMS-PIPELINES@VM.MARIST.EDU
> > > Subject: Pick a record at random?
> > >
> > > I need to decide which of a set of worker userids to give a spool 
> > > file to. I want to pick the one with the fewest total 
> spool files. 
> > > If there are multiple users with the same
> > > (lowest) number, I want to choose one at random (for load 
> balancing 
> > > purposes). I already have code that does the queries and outputs 
> > > records with the total number of spool files right justified in 
> > > columns 1-10 (padded with leading
> > > zeros) and the name of the userid in columns 12-19. For example:
> > >
> > > 0000000002 xagentu2
> > > 0000000157 xagentu3
> > > 0000000010 xagentu8
> > > 0000000002 xagentu5
> > > 0000000007 xagentu4
> > > 0000009996 xagentu6
> > > 0000009999 xagentu7
> > > 0000000002 xagentu
> > >
> > > From those I need to (somehow) choose those with the fewest:
> > >
> > > 0000000002 xagentu2
> > > 0000000002 xagentu5
> > > 0000000002 xagentu
> > >
> > > From those, I want to pick one at random and then give 
> the new spool 
> > > file to the named user (i.e. I want the output of the 
> pipe to be the 
> > > userid to use).
> > >
> > > I could load them into a stem and use the Rexx Random() 
> function, I 
> > > suppose, but was curious if there's a PipeThink way to do it.
> > > --
> > > bc
> > >
> >
> 

Reply via email to