I got a nasty surprise this morning. I run a batch routine that generates a couple of thousand or so letters from E-Business Suite every night and then prints them – via CUPS – to a series of networked printers. This has worked since the year dot. It has never let me down…. until that is, this morning when it let me down big style.
The first 500 letters were queued and then subsequently printed. The other 2500 were rejected by CUPS. (I should mention at this point that the letters are printed individually thus each letter generates a print job meaning 3000 or so print jobs should’ve been created and subsequently printed off).
After the first 500 letters went of to CUPS I started to see a message in my application log:
lp: Too many active jobs
I have never seen this message before. Well weird considering the number of print jobs that have gone through the system.
To cut a long story short the solution to my print problem was to change a parameter in cupsd.conf
By default CUPS will queue a maximum of 500 print jobs before rejecting further print requests. To quote directly from the CUPS manual :
MaxJobs directive controls the maximum number of jobs that are kept in memory. Once the number of jobs reaches the limit, the oldest completed job is automatically purged from the system to make room for the new one. If all of the known jobs are still pending or active then the new job will be rejected.
Setting the maximum to 0 disables this functionality. The default setting is 500.
So I added
MaxJobs 0 to my cupsd.conf file, restarted CUPS, did a fairly large scale test (about 1000 jobs sent) and all is well. I’ll update this post at some point as I’ve heard setting
MaxJobs 0 can have unpleasant side effects in terms of Memory and CPU consumption.