MaxClient setting and file descriptor

Kurt Pfeifle k1pfeifle at gmx.net
Tue Jul 3 02:27:17 PDT 2007


angelb wrote:

> # grep descriptor error_log
> I [02/Jul/2007:22:59:22 -0500] MaxClients limited to 1/3 (341) of the file descriptor limit (1024)...
> 
> Our MaxClients is currently set to 2048 and I want to change that to a
> higher value but I'm not certain on how to make the change and make it
> effective.

Why is that? How many print clients do you have for your cupsd, and how
likely is it that they (or even only 3% of them) will make a connection
that needs processing at the same time?

> And is my assumption of Clients in "MaxClients" refers to the printer
> queues in the CUPS clients?

You can verify your assumption by parsing these lines in your help files
(http://localhost:631/help/ref-cupsd-conf.html?TOPIC=References&QUERY=#MaxClients):

  "The MaxClients directive controls the maximum number of simultaneous
   clients that will be allowed by the server. The default is 100 clients.

          Note:  Since each print job requires a file descriptor for the
                 status pipe, the scheduler internally limits the MaxClients
                 value to 1/3 of the available file descriptors to avoid
                 possible problems when printing large numbers of jobs."

"Simultaneous"!

You can have 24000 print clients, where each of them prints 1 one-page job
per day. That gives you on avarage 1000 connections for the CUPS server per
hour, or 1 every 3.6 seconds (*for* *the* *purpose* *of* *job* *submission* !),
right? And yet this may mean no more than 10-30 *concurrent* job submission
connections at the peak time (due to the uneven distribution of job submissions
over the 24 hour time period).

That's why I asked you earlier about the "lpstat -o" figure (for typical times
as well as for peak times): if you never see more than 30, why raise the
MaxClients setting to more than 100?

Granted, every "lpstat -o", or "lpoptions -d printername", or "lprm $jobid",
or "lpstat -p", or a BrowsePoll request by a client, or clicking on any link
in the web interface also makes a client request/connection.

You can find out the number of client requests by looking into the access_log
file. Every line roughly represents one request. Counting lines per minute
gives you an idea about your overall server load. And how many requests are
related to print job submission, how many to BrowsePoll requests, how many
to other queries...

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