I have just finished roughing out the way that I plan to cache status
for LPRng.  The reason for this is two fold:

a) Samba folks convinced me that status caching was good for them
b) On HUGE systems the overhead of doing multiple queuies for the
   same data by different users was bringing the system to its
   (figurative) knees.

The idea is that each queue will have a list of the last N (configurable)
LPQ queries,  and will save the queuery results in a file.  The
following can be used to tune the caching:

lpq_queries_cached= N (default   10)   - cache last N queries
lpq_stale_time    = S (default 3600)   - number of seconds until the status is stale
lpq_interval      = S (default    2)   - minimum interval between updates

The cache information will be stored in a file in the spool directory.
Only information for this particular queue will be cached.

In addition to the cache,  I am adding an 'lpc cache' command:

lpc cache pr [options]
  corresponding to
lpq -Ppr [options]

The lpc cache pr will return:

pr xxxx\n   where xxxx is a string indicating the time
            of the last cache update OR
pr\n        indicating stale or no cached information  

Note that for a 'cascading' printer queue stream you
might get more than one cache result:

lpq -Ploadbalance

loadbalance xxxx
server1 xxxx
server2 xxxx

If any of this has changed you should query or get the
new status.  Note that the status returned will be from
the caches of the individual queues so that there
will not be much of an overhead except for the ones that
need to be updated.

Patrick Powell

-----------------------------------------------------------------------------
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