[cups.general] how to allow only one job at a time (andqueueeverything else)?

Kurt Pfeifle k1pfeifle at gmx.net
Mon Oct 15 04:56:46 PDT 2007


Tomasz Chmielewski wrote:
> Kurt Pfeifle schrieb:
>> Tomasz Chmielewski wrote:
>>
>>> Is there a way to configure CUPS so that it runs only one filter job at
>>> any given time? 
>>
>>
>> Have a look at the "FilterLimit" directive in cupsd.conf. See
>>
>>  
>> http://localhost:631/help/ref-cupsd-conf.html?TOPIC=References&QUERY=#FilterLimit
>>
>>
>> "FilterNice" may provide some additional relief.
> 
> I've read about it, but I don't understand it.

What's wrong with the advice of

   "setting the limit below these thresholds will effectively
    limit the scheduler to printing a single job at any time."

It translates into a cupsd.conf line of

FilterLimit 190

that will effectively limit cupsd to process only one single job
at any one time.


> This is the explanation in the fine manual:
> 
> #######
> 
> Examples
> 
>       FilterLimit 0
>       FilterLimit 200
>       FilterLimit 1000
> 
> Description
> 
> The FilterLimit directive sets the maximum cost of all running job
> filters. It can be used to limit the number of filter programs that are
> run on a server to minimize disk, memory, and CPU resource problems. A
> limit of 0 disables filter limiting.
> 
> An average print to a non-PostScript printer needs a filter limit of
> about 200. A PostScript printer needs about half that (100). Setting the
> limit below these thresholds will effectively limit the scheduler to
> printing a single job at any time.
> 
> The default limit is 0.
> 
> #######
> 
> What does "the maximum cost of all running job filters" mean?

Each filter has a "virtual cost" associated with it (the currency is
non-tradeable at the stock market AFAIK, but it is called "CUPS Dollar").

Seriously, there *IS* this cost thingie, and you can read it in the
file /etc/cups/mime.convs and in the PPD file.

To process a job completely, from submitted file format to final format
digestible by the target device, cupsd needs to run it through a chain
of filters (where the "chain" sometimes may be composed of 0 or 1 only
chain links). The cost of each of the filter is added to compute the
total and compared to the set "FilterLimit" value to determine if the
job should be processed now or later.

A line in mime.convs like

application/postscript   application/vnd.cups-postscript   66  pstops

assigns a cost of "66" to run the pstops filter once, for said mime
type conversion from "application/postscript" to "application/vnd.cups-
postscript".

A line in the PPD like

*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"

assigns a cost of "0" to run foomatic-rip as the last filter in the
chain before the result goes to the CUPS backend which sends it off to
the print device.

This means, you may need to change the PPD *cupsFilter line to s.th.
like

*cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip"

in order to make the cupsd.conf FilterLimit effective at all for
foomatic-rip filtering. (Note that foomatic-rip isn't part of CUPS, it
is a 3rd party hack to make drivers that are included in Ghostscript
and some other packages work with CUPS).

> So, if I want to allow max one filter (which may consist of multiple
> processes: foomatic/ghostscript/foo/bar/etc.) at any given time, and
> queue other jobs, what FilterLimit should I choose?
> 
> FilterLimit 1?

Should work.

> FilterLimit 100?

Should work too.

> FilterLimit 200?

Will probably allow 2 or 3 concurrently processed jobs (filters
running).

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list