[Samba] Re: Re: Re: A lot of IPC$ connections

Michael Sweet mike at easysw.com
Thu Nov 10 16:15:23 GMT 2005


Gerald (Jerry) Carter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Franz Pförtsch wrote:
> | Thanks for help.
> |
> | I am using SuSE SLES9 samba-3.0.14a.
> |
> | the precompiled value is 0.
> | I setted the value to 360.
> |
> | Can you explain the differend values?
> | I created one printer and the printer was
> | immediately visible at the windows-explorer?
> 
> The printcap cache time defines an interval in
> seconds after which smbd will look for any new or
> removed printers.
> 
> You have a couple of possibilities here.  You can
> manually define each printer in smb.conf (and remove
> [printers]) or you can seet "printcap name = /etc/printcap"
> to use the cupsd generated file.  The problem is more
> that the cupsd daemon appears to be quite slow when
> we try to validate a large number of printer names.

The printer lookup in CUPS 1.1.x is a linear time implementation,
and so can slow down exponentially as the number of printers
increases.  CUPS 1.2 switches to a new cupsArray API for managing
the printer and implicit class lists and scales much better.

That said...

> Michael, Is there a better way to get cupsd to validate
> a printer name or something that could be tweaked to
> speed it up?  We can change the Samba code if we are
> doing something wrong.  I think it is currently still close
> to your original code.

I'm looking at the code now.  cups_cache_load() seems to be
doing the right thing - only requesting the attributes it
needs, and getting all of the printers in one lookup.  You
can eliminate the CUPS_GET_CLASSES request/loop with CUPS
1.2 (CUPS_GET_PRINTERS now returns both printers and classes
by default)...

It would be interesting to know how many printers are involved
and to determine whether the bottleneck it in cupsd, smbd, or in
the link between them...  Given that pcap_cache_t is currently
implemented as a linked-list, I'm suspecting that there is some
inefficiency there (but that really depends on how many printers
you are using...)

FWIW, if you are interested, I'd be happy to donate the cupsArray
API for use in SAMBA - the API provides a general (sorted) array
implementation with efficient lookup (O(log N)) and enumeration
(O(1)) functions.  Browse at:

     http://svn.easysw.com/public/cups/trunk/cups/

We're making more and more use of it in CUPS as a whole, which
should greatly improve the performance/scalability/reliability of
the code base...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com


More information about the samba mailing list