[cups.general] Detect Printer failure & high CPU usage

Johannes Meixner jsmeix at suse.de
Tue Oct 12 01:57:27 PDT 2010


Hello,

On Oct 10 12:13 Elly K wrote (shortened):
> I got CUPS 1.4.4 running on a virtual (SLES 10.3) Linux server
> on an IBM Mainframe. I use this server to print PDF's
> from my java application.  And I have a few questions

If you have whatever official support contract, I recommend
to use it to get official support for what you have set up.
Any help via cups at easysw.com is only informal and voluntary
and neither official support nor is there any kind of warranty.


> 1) From the CUPS JOBS web page, I can see information
> on some printers about "Broken Pipe" and then there are
> messages about "foomatic failed" etc.,  What I tried to do
> in my Java application was to use the Runtime..exec() methods
> to read this JOBS web page and generate emails if I find
> strings matching "Broken pipe" or "failed" - Turned out to be
> a bad idea.  Most of the time, the web page is read in time,
> but sometimes it takes a long time and it creates a serious backlog.
> Is there a more reliable way to detect printer problem situations
> from my java application?

I don't know about Java but you may use CUPS "subscriptions"
which let the cupsd send emails in case of particular events, see
http://www.cups.org/documentation.php/doc-1.4/ref-subscriptions-conf.html


> 2) When I print my PDF's I see a process called gs executing and
> sometimes there are multiple instances of gs running based
> on print requests.  My question is the CUPS server always seems
> to be using a lot of CPU when it's being used.  When not in use,
> the CPU use is almost nothing.  But when it is being hit even
> for a couple of pages, the usage briefly spikes to 99% before
> retreating.  And when there's heavy load, the CPU is pegged
> at 99% for a while.  Is this normal?

This is normal - it is even better than normal. It would be a
bug in the CPU scheduler in the Linux kernel if it would try
to avoid that the CPU is actually used when it is actually
needed. Ghostscript may need very much CPU to render
the PostScript of the document which is to be printed
depending on the actual PostScript of the document.
If you are interested in some special PostScript examples
you may search in Google e.g. for "PostScript raytracer".


> 3) I would like to have another CUPS server to act as a backup
> to the main server.  In case, the main server is down or under
> heavy stress, I would like this backup server to take some
> of the load. I'm sure there's plenty of software out there
> to do this sort of thing, but any ideas on how to do this
> the best way?

At the moment I don't know about a comprehensive documentation
which provides background information and describes details
about "load balancing and fail-safe printing functionality"
except the snippet in
http://www.cups.org/documentation.php/doc-1.4/spec-browsing.html
------------------------------------------------------------------
A key feature of CUPS printer sharing is support for implicit
classes, which are automatically-created classes for printers
that are shared by multiple servers. These implicit classes
provide automatic load balancing and fail-safe printing
functionality transparently to the user. 
------------------------------------------------------------------

This means:
Run two servers simultaneously and use the default CUPS browsing
(i.e. let both servers announce their queues simultaneously and
let the client systems accept the announced queues from both servers)
so that CUPS' default "implicit classes" results load balancing
on the server and fail-safe printing functionality on the clients
automatically.

There could be problems if the same network printers are used
by both servers simultaneously (i.e. when both servers try to send
printing data to one same network printer simultaneously), see
http://en.opensuse.org/SDB:Printing_via_TCP/IP_network
In this case you would have to split those network printers
which cause such problems into two sets to that the network
printers in one set belong only to one server and the network
printers in the other set belong only to the other server.
Then there would be still load balancing but there would be
no longer the automated fail-safe printing functionality
for those printers.

Probably the section
"Intrinsic design of CUPS for printing in the network" in
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell
is also helpful here.

Regarding "implicit classes" and security, also have a look at
"What is Specific Regarding Firewall Setup for Printing" in
http://en.opensuse.org/SDB:CUPS_and_SANE_Firewall_settings


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex





More information about the cups mailing list