> From [EMAIL PROTECTED] Wed Jun 28 12:02:12 2000
> Date: Wed, 28 Jun 2000 13:03:47 -0400
> From: "Damian, G. C. (Gerald)" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: :chooser option for load balancing queues
>
> Patrick,
>
> I need a little more explaination on using the chooser option for load
> balancing queues.
>
> Prior to 3.6.18 the check_idle option was used in the sub queues. The
> check idle processes for each sub queue ran util they detected a change 
> in status(busy->idle).
>
> Now using the chooser option, the main queue gets a list of all its
> sub queues and checks their status. I've got a chooser script that
> checks
> the Appsocket connections to my Phaser printers. (It essentially checks
> for "idle" on UDP port 9101 and the ability to connect to TCP port 9100.
> I had to do this since for my Tek 360s, connections are refused on 9100
> even though 9101 says idle. This is an old problem reported on prior 
> postings.) If both checks are OK, my chooser exits with 0 and writes the
> appropriate subqueue name to STDOUT.
>
> Question #1:
>
> Should the chooser run until it detects a free subqueue like check_idle
> or
> exit with an error if it can't find any available subqueues? (Mine runs
> until it finds a free subqueue.)

If there are jobs in the queue then the lpd server will periodically poll
the printers.  Do NOT sit in and endless loop.  The metacode that LPRng
is using looks like:

 while there are printable jobs in the queue do
   retry:
   foreach job in the queue do
     echo >list
     for all queues that are not busy
         echo "queue" >>list
     endfor
     printer=`chooser <list +all the ugly filter options`
     case exitcode is
       JABORT  :  stop processing queue
       JREMOVE :  remove job;
       JFAIL   :  continue;
       JSUCC   :  exit loop with printer and job information
     endcase
   endfor
   if printer and job information then
      print job on printer (actually start a process)
   else 
       wait for a process to exit with timeout of 'chooser_interval seconds'
          or until a signal or something interesting happens
   endif
 endwhile

The 'chooser_interval' value determines how often the printers
are polled.  Note that this polling is done each time a subserver
queue 'service process' exits or a new job is put into the
queue.

>
> Question #2:
>
> How should I handle the error condition where I can't make a connection
> or
> get status from one remote printer, but another is available? As long as
> at least one subqueue is available jobs will get sent, however, the
> master
> queue will never know there is a problem on one of its subqueues. Should
> I
> JABORT if I find a serious problem on any subqueue?

In the chooser program you may want to disable the queue (lpc disable)
send mail, flash lights, or whatever.   How you handle this is up to
you.

>
> --------
> Jerry Damian             | Ford Email: [EMAIL PROTECTED]  
> Ford Motor Co./RCS Dept. | Internet Email: [EMAIL PROTECTED]          
> SRL MD 1074 RM 1116      | ph: (313)32-38347 fax: (313)39-04865      
> Dearborn, MI 48121-2053  | my opinions != Ford's opinions or policy

Good Questions!

Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.astart.com)

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to