[PATCH 0/7] printing: improve printcap update CPU usage
jra at samba.org
Mon Aug 4 16:31:55 MDT 2014
On Tue, Aug 05, 2014 at 12:26:20AM +0200, David Disseldorp wrote:
> On Mon, 4 Aug 2014 15:58:00 +0200, David Disseldorp wrote:
> > This patch-set attempts to address bug 10652: Samba consumes a lot of
> > CPU when re-reading printcap info.
> > It does so with the following changes to the printcap update procedure:
> > - Use traverse_read for printer list share updates, instead of exclusive
> > (write locked) traversals. This significantly reduces printer_list.tdb
> > lock contention.
> > - As suggested by Volker, reload per-client smbd printer share
> > inventories on client enumeration, rather than immediately after every
> > printer list update.
> > - If enumeration is requested but the printer list has not changed,
> > then skip the printer share inventory update.
> Looks like one further change is needed here to handle clients that do
> not enumerate printers prior to open, such as cupsaddsmb.
While you are going around one more time on this, can you
move the function delete_and_reload_printers_full() from
source3/smbd/server_reload.c -> source3/printing/queue_process.c
and make it static ? Also, if you could eliminate the duplicate
definitions of snum_is_shared_printer() in source3/rpc_server/spoolss/srv_spoolss_nt.c
and in source3/smbd/server_reload.c that would be great also :-).
Sorry for asking for more, but these extra things would
really help clean up the printing code somewhat, and make
it clearer what's being done in the background process.
More information about the samba-technical