Closed vliaskov closed 5 months ago
This debugging is not intended for production environments, but we can look into making it more efficient in a future release of CUPS.
This debugging is not intended for production environments
I assume by this you mean to recommend to completely disable debug logging capabilities in production i.e. not use --enable-debug-printfs
at all for building cups in production. Is that correct?
we can look into making it more efficient in a future release of CUPS.
Thanks. This particular problem though seems to be that, in high load cases, this debug loop affects performance even with lower debug log levels than the one used for the actual loop.
This debugging is not intended for production environments
I assume by this you mean to recommend to completely disable debug logging capabilities in production i.e. not use
--enable-debug-printfs
at all for building cups in production. Is that correct?
Yes, correct.
we can look into making it more efficient in a future release of CUPS.
Thanks. This particular problem though seems to be that, in high load cases, this debug loop affects performance even with lower debug log levels than the one used for the actual loop.
Again, we can look into making it more efficient, but debug logging necessarily isn't concerned with performance as much as it is concerned with allowing the CUPS developers to debug problems with the software during development.
I ended up just removing this debug code since we don't have it in libcups v3.
@michaelrsweet thank you for your prompt reply! It helped a lot.
A general addedum FYI:
There is a dilemma of having even advanced debugging functionality ready to use for users so when a special issue hits a user all debugging is directly possible at the user's system without the need that someone must provide a user with an extraordinary problem a specially built CUPS to get advanced debugging functionality enabled versus performance loss because of debugging functionality.
In particular as in this case when a problem is
Only reproducible in customer's setup.
Then ready to use advanced debugging functionality could normally help to understand the user's problem but here in this particular case the ready to use advanced debugging functionality was unfortunately the cause (or at least one reason) for the problem.
I think the actual root cause in this particular case is that the cupsd runs basically overloaded so that it cannot process the load "as usually expected" and then various things fail in various unexpected ways here and there. My reason why I think that this is the actual root cause is that we (i.e. SUSE) don't know about other issues like this which proves what I wrote in https://github.com/OpenPrinting/cups/discussions/873
... things do work well in practice
up to hundreds of print queues
on a single server under normal conditions
even with advanced debugging functionality built-in.
Describe the bug
Customer faces job processing and monitoring delays that can go up to at least 10 seconds. Stacktraces during the delay points to:
The
_cups_debug_printf
calls are coming from this loop incups/array.c:cups_array_add
Customer uses
LogLevel info
(CUPS_DEBUG_LEVEL
=7) or less; this is less thanLogLevel debug2
(CUPS_DEBUG_LEVEL
=9) which is used in the loop's printfs, so no debug output is not printed.Even so, the large number of
a->num_elements
(~1M) meanscups_debug_printf
checks the debug log level ~1M times. I suspect this may be a cause of delay.I wonder if this change to simply not enter the debug loop with debug level < 9 would be accepted:
While code outside
cups/debug.c
shouldn't normally check_cupsd_debug_level
I seecups/http.c: http_debug_hex
also directly checking the debug level.To Reproduce
Only reproducible in customer's setup. This stresses cups as it uses more than 3000 print queues.
Expected behavior
Debug code should not cause performance problem / delay when the debug level is less than that specified for the debug code to be executed.
System Information:
Additional context Follow the instructions from the REPORTING-ISSUES document and provide all information regarding the issue.