file descriptor limit and MaxClient - revisited

Michael Sweet mike at easysw.com
Fri Jul 6 23:47:20 PDT 2007


angelb wrote:
> ...
> Looks like the maximum clients per host will always be 341 regardless
> of what your system's OFD setting is.

No, for CUPS 1.2 it depends on the maximum number of file
descriptors supported by the select() on your platform.  For
some you can use up to 64k file descriptors, but most limit
select() to 1024 file descriptors.  Internally, CUPS limits
the maximum clients to 1/3 of the maximum select() file
descriptors, in order to leave enough file descriptors open
for printing jobs...

CUPS 1.3 adds support for poll(), epoll(), and /dev/kqueue
which allows us to support an arbitrary number of file
descriptors, so we don't limit to FD_SETSIZE / 3.

> ...
> Also, I don't quite understand how this MaxClient and MaxClientPerHost
> works. If my assumption is correct, Client in this context refers to
> "printer queues?" and "host" is the clients that runs the cupsd where
> print jobs are sent.

Client refers to a connection from another system to do any task -
printing, job management, polling, etc.  A CUPS client will
connect to the server for every remote queue that is active, and
also if you have a BrowsePoll directive.

> And so, the MaxClients in the server dictates how many queues, at any
> given time, can connect to the server. And the MaxClientPerHost also
> tells how many "printer queues", from a client at any given time, is
> allowed to connect to the servers.

Effectively, yes.

> So, if the server only allows 341 printer connections, and say you have
> 10 clients, assuming one of your client consume all of the 341
> connections at any given time, the other 9 clients will never be able
> to print.

.... for as long as those other 341 connections are active, which
in a normal environment doesn't happen too much since print jobs
are transferred quickly...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com




More information about the cups mailing list