Description of problem:
Upstream revisions 7314--7324 fix several inefficient code paths in cups-browsed:
- when listening for CUPS Browsing packets, cupsGetDests() is called each time a packet is received, fetching the entire list of local printers
- when using BrowsePoll, cupsGetDests() is called for each remote printer discovered
- when sending CUPS Browsing packets, cupsGetDests() is called each BrowseInterval
The fixes (a) fix IPP notification handling and (b) use it to track changes in local printers. If there are no changes, recomputing is avoided.
This takes load off cupsd as well as cups-browsed.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Run 'cupsctl --debug-logging' (as root)
2.Run 'cups-browsed --debug' (as root)
3.Watch /var/log/cups/error_log to see how many times CUPS-Get-Printers is requested
Happens in the situations described above.
Only happens after changes to the local printers.
Recommend just using the latest utils/cups-browsed.c. It also fixes several instances of searching through lists for things that should be in hash tables, etc.
I'd add couple comments here -
cups-browsed seems to be the only 'permanent'daemon process which is able to keep my fan spinning.
IMHO - it really should do any 'ipp' processing only when it's really queried for some list of printers.
i.e. I print something just few times per month - yet - long office printer list is processed with poor slow CPU hunger parser every minute.
And not just that - even my '/etc/hosts' file with longer list of blocked sites seems to be scanned every minute because of this.
Would be very cool to see 'browsed' only collecting list of printers addresses - and processing them just when needed (thus just following systemd design) - I've no problem to get the list of printers some miliseconds later...
FWIW: The "right" way of doing this is not to use cups-browsed at all. It is only there for applications that do not use libcups (and its client-side DNS-SD discovery), and instead use their own discovery by querying the local cupsd process, expecting that cupsd does discovery (it doesn't, since 1.6).
If all the applications did it this way, discovery would be entirely on demand.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.