[cups] tuning CUPS for centralized printing

Kurt Pfeifle kurt.pfeifle at googlemail.com
Wed Aug 24 00:24:04 PDT 2016


>
> Date: Mon, 22 Aug 2016 18:29:09 -0500 (CDT)
> From: Tim Mooney <Tim.Mooney at ndsu.edu>
> To: cups <cups at cups.org>
> Subject: [cups] tuning CUPS for centralized printing
>
>
> All-
>
> I'm looking for tuning suggestions for what other sites tune when running
> a central CUPS server, especially universities that use CUPS for printing
> in their computer labs.
>
> The tl;dr version:
>
> What are other universities using for MaxClients and MaxClientsPerHost?
> What other tunables have you found important to set for your environment?
>
> The full version:
>
> Our print server is a dual hexacore (+hyperthreading) Xeon E5-2620, with
> 32 GiB RAM.  It's running RHEL 6.x, which means the 2.6.32 kernel and
> CUPS 1.4.2 (+ vendor sauce, as Michael would say).
>
> We have about 130 queues defined within CUPS.  All job submission is done
> via ipp.  Michael's advice last year steered me away even considering
> cups-lpd.  All queues are set to hold the print job once it is submitted.
> We use additional print management software (in this case, GoPrint)
> that integrates with our campus card system that allows students and
> faculty to select their held print jobs.  It's that software that
> issues the Move-Job/Release-Job commands to CUPS, to cause the job
> to be sent (socket to port 9100) to one of our 60+ HP printers.
>
> The print management software also automatically discards
> (Delete-Job) print jobs that aren't released within a period of time,
> so that we don't have jobs sitting on the system for more than a few hours.
>
> We have close to 600 Windows PCs (mainly Windows 10 Pro) and about 100
> Macs (OS X 10.11, El Capitan) in those labs.  In addition, as much as
> possible, we try support "bring your own device" (BYOD), which amounts to
> a lot of Windows 7, 8, 8.1, and 10 laptops and all of the versions of OS X
> that are still receiving updates from Apple.  Obviously, tablets and
> phones are also hugely popular, but for these purposes I'm mainly
> interested in tuning for traditional desktop & laptop use.
>
> During peak periods of the day and peaks in the academic cycle, most of
> our lab systems will be in use, though obviously not everyone is printing
> at once.  In the past, before we switched to using CUPS as our print
> spooler, we had seen peaks of between 35K and 40K print jobs submitted
> to the print server per day, though not all of those jobs were actually
> selected and released to a printer.
>
> With that lengthy and hopefully useful information about the
> environment, now the questions.
>
> 1) Does anyone have a rough idea how much RAM is used for each
> concurrent client connection?  I'm trying to get an idea of how high
> I can safely set MaxClients while still leaving plenty of RAM free
> for filesystem cache and other processes, including the print management
> software.
>
> 2) What's a reasonable setting for MaxClientsPerHost?  I currently have it
> set to 16, but we're seeing log entries indicating that some clients are
> attempting to initiate more than 16 concurrent connections.  Under what
> conditions is that "normal"?
>
> 3) I have
>
>         MaxJobs 0
>         PreserveJobHistory Off
>         PreserveJobFiles Off
>         ErrorPolicy retry-job
>         JobRetryInterval 60
>         JobRetryLimit 60
>
> set.  What other tunables, beyond MaxClients/MaxClientsPerHost, should I
> be looking at (and why, if it's not obvious from the CUPS docs)?
>
> 4) Any other system tuneables (things like net.core.rmem_max,
> net.core.somaxconn, etc.) that you've had to tune for a busy CUPS server?
>
> 5) Any client-side settings that you've found that make Windows or Mac
> clients work more reliably with a CUPS server?
>
> I appreciate any suggestions people might have, especially people that are
> running a busy, centralized CUPS server in a large campus environment.
>

Your description of your printing environment suggests that the bulk of
print clients are Windows machines:

60+ HP printers
130 CUPS queues
600 Windows PCs
100 Macs
plus "lots of BYODs"

Questions:
1. Are your HP printers supporting PostScript printing? Or are they
PCL-only devices?
2. Which printer drivers do your 600 Windows PCs use?
3. Am I right to assume that the CUPS queues are "raw" ones (i.e. not
"filtering" jobs / not converting incoming print data mime types into
different ones, for example PostScript into PCL)?

In case your CUPS queues DO perform filtering (non-raw queues), one
tuneable parameter would be "FilterLimit". Another tuneable in this case
would be to try and abolish the filtering by re-configuring the queues (and
the Windows drivers, respectively).

You could also benchmark what sum of print data files your Windows clients
produce per typical day if...
a) ...all of them used PCL printer drivers for all jobs
b) ...all of them used PostScript drivers for all jobs
(This cannot be answered for the general case -- it also heavily depends on
the type of documents your users need to print, and which settings they
prefer or must use for some reason.)

For a first impression about the load imposed on the CUPS server system by
total filter processes running for all jobs of the day, do the following:

1. Put CUPS into debug logging mode for a day: `sudo cupsctl
--debug-logging`
2. Run a command like:

        grep "Started filter /usr/lib/cups/filter" /var/log/cups/error_log \
          | grep "25/Aug/2016"  \
          | cut -c 31-  \
          | sort | uniq -c

This should output a summary statistic of all filter processes that have
been running on the day. If you have only raw queues, there will be no
result (and there will be no need for tuning in that respect).



More information about the cups mailing list