[cups.development] CUPS can't handle high frequency of reques t!

Sanjay Mishra Samishra at quark.co.in
Thu Jul 15 06:23:10 PDT 2004

Hi Mike,

The system configuration is as follows:
	RAM 256MB,
	800 MHz single processor
	Hard disk size 40GB 
Operating System:
	Mac OS 10.3
MyApplication Requires: 
	Virtual Memory :300MB * n [ n for number of process my application
spawn. Default is 4 and I am currently testing on this default value.]

I know this error of "can't fork..." is due to reaching the limit for the
number of descriptors a system can open. Currently when I am  testing I
don't run any other application.

It appears that the problem with setting the MaxClientPerHost is that the
CUPS itself checks for the value to be less than 1/3rd of the 4096 and if it
is more than that then it sets the value equal to the 1/3rd and throws an
error message of "maxclients limited to 1/3 of the file descriptor
limit(4096)" followed by "configured for upto 1365 clients". Can you confirm
this ? Could this limit be the reason for my problem.

When I configured PreserveJobHistory to "No" and MaxJobs to 0 for no limit
it did increase the transaction count significantly. I haven't tried with
FilterLimit values. I assume it might not have any affect.
My CUPS Filter does not do much job except calling another filter (already
existing in the Mac OS) using execlp() and wait()'s on it. When wait()
returns it simply ends.

The most important point is this problem comes only on single processor
system. On Dual processor my application and the filter works fine without
any problem.

When I tested using lsof command I got the list of 800 files still open when
error started coming in.

Where are the problem areas ? Where should I look into ?

Sanjay Mishra

-----Original Message-----
From: cups-dev-bounces at easysw.com [mailto:cups-dev-bounces at easysw.com]On
Behalf Of Michael Sweet
Sent: Thursday, July 15, 2004 3:21 PM
To: cups-dev at easysw.com
Subject: Re: [cups.development] CUPS can't handle high frequency of

Sanjay Mishra wrote:
> My system has high traffic for creating PDF files and I have a CUP 
> filter (myCUPSFilter)which simply transfer the data it received to 
> pictwpstops filter. After around 100 transactions I find that CUPSD 
> throws errors like 'can't fork myCUPSFilter".

That's an OS error - basically you have too many processes running
or too much VM is in use.

> But when I slow down the traffic a bit( reducing the freqeuncy with which
the request was 
> received) the number of transactions increased to 600 and more without 
> any error. Could any of you give any idea where to look for.
> I also increased the MaxClient value to 1000 and MaxClientPerHost to 300 
> as I wanted a different number than 10% of MaxClient. This change alone 
> increased the transaction count to 140 without errors.
> Is it that CUPS can't handle high traffic and client should control the 
> frequency of the request? Or there are some configuration parameters 
> that I missed out and must do to run my application.

Without knowing more about your configuration (both hardware and
software), it is hard to say specifically, however the error that
you are getting indicates that you have more processes running
or more VM in use that can be supported by your system.

If it is a matter of running too many jobs at the same time, the
FilterLimit directive can be used to throttle that back, however
I don't know if that will help in your case or not.  The size of
the job history could also be an issue, as each fork() effectively
duplicates the VM of the server before it does an exec() of the
filter program - check the MaxJobs and PreserveJobHistory values.

The CUPS server can certainly handle high traffic situations -
that's why you are running into this issue! :)  (otherwise the
jobs would not be coming in fast enough to matter...)

Michael Sweet, Easy Software Products           mike at easysw dot com
Printing Software for UNIX                       http://www.easysw.com
cups-dev mailing list
cups-dev at easysw.com

More information about the cups mailing list