Some Statistics (was: "Excessive Get-Printer-Attributes in CUPS")

Kurt Pfeifle k1pfeifle at gmx.net
Tue Jul 24 11:40:54 PDT 2007


Kurt Pfeifle wrote:
> Jeff Hardy wrote:
>> On Mon, 2007-07-23 at 07:34 -0700, Kurt Pfeifle wrote:
>>> Jeff Hardy wrote:
>>>
>>>> load printers = yes
>>>> printing = cups
>>>> printcap name = cups
>>>> cups options = raw
>>>> show add printer wizard = yes
>>>> addprinter command = /usr/local/bin/smbaddprinter.pl
>>>> deleteprinter command = /usr/local/bin/smbdelprinter.pl
>>> These may well be the complete parameters written down in smb.conf by
>>> you that relate to printing.
>>>
>>> But for sure these are *NOT* the complete parameters used by Samba!
>>>
>> Kurt and Franz,
>>
>> Thanks for your replies.
>>
>> Actually I was aware of all the default definitions, and should have
>> included the complete list in my first post:
>>
>> # testparm -sv | grep -E "print|driver|lp|cups|spool"
>> Load smb config files from /etc/samba/smb.conf
>> WARNING: The "printer admin" option is deprecated
>> Processing section "[printers]"
>> Processing section "[print$]"
>> Processing section "[drivers]"
>> Loaded services file OK.
>> Server role: ROLE_DOMAIN_MEMBER
>>         lpq cache time = 30
>>         load printers = Yes
>>         printcap cache time = 750
>>         printcap name = cups
>>         cups server = 
>>         iprint server = 
>>         disable spoolss = No
>>         addprinter command = /usr/local/bin/smbaddprinter.pl
>>         deleteprinter command = /usr/local/bin/smbdelprinter.pl
>>         show add printer wizard = Yes
>>         os2 driver map = 
>>         printer admin = @printeradmins
>>         min print space = 0
>>         max reported print jobs = 0
>>         max print jobs = 1000
>>         printable = No
>>         printing = cups
>>         cups options = raw
>>         print command = 
>>         lpq command = %p
>>         lprm command = 
>>         lppause command = 
>>         lpresume command = 
>>         printer name = 
>>         use client driver = No
>>         force printername = No
>>         printjob username = %U
>> [printers]
>>         path = /var/spool/samba
>>         printable = Yes
>> [print$]
>>         path = /var/shares/drivers
>>         write list = @printeradmins
>> [drivers]
>>         path = /var/shares/driverpaks
>>         write list = @printeradmins
>>
>>
>> I read about printcap cache time before, and have since tried manually
>> setting it to a variety of settings.  My first post was when it was at
>> its default of 750.  Seems that no matter what that is set to, same
>> behavior.
>>
>> I should mention that this machine has some 270 queues, and is seeing
>> very light duty right now.
>>
>> -Jeff
> 
> 
> What happens if you set to an empty value "cups options = ''" ? (but
> make at the same time sure that raw printing is allowed on the cups
> site by editing the last lines in /etc/cups/*{.types,.convs} in case
> you need raw printing support)?
> 
> Can you get an exact count of how many "Get-Printer-Attributes" requests
> you are seeing per second on avarage?
> 
> Are these requests evenly distributed, or are there bursts?
> 
> Did you consider to do a network trace to see why sometimes you get
> "successful-ok", sometimes "client-error-not-found"?
> 

So, to answer some of my own questions....

I just had the opportunity to ssh into a CUPS/Samba production print
server of mine and harvest some current figures (Samba is 3.0.25b,
CUPS is 1.2.12).


This is a CUPS serving 86 printers to a Windows AD domain. In cupsd.conf
the LogLevel setting is to debug.

# As you can see, this is a rather large logfile:

  [root at cups]# ls -lh access_log
  -rw-r--r--  1 root lp 68M Jul 24 19:50 access_log


# It's been accumalated over the course of a week:

  [root at cups]# head -n 1 access_log
  localhost - - [17/Jul/2007:11:54:32 +0200] "POST / HTTP/1.1" 200 129 CUPS-Get-Printers successful-ok

  [root at cups]# tail -n 2 access_log
  localhost - - [24/Jul/2007:19:36:43 +0200] "POST / HTTP/1.1" 200 195 Get-Printer-Attributes successful-ok


# Here are a few line counts:

  [root at cups]# wc -l access_log
  677036 access_log

  [root at cups]# grep "CUPS-Get-Printers" access_log|grep successful-ok|wc
  132769

  [root at schlxs030 cups]# grep "CUPS-Get-Classes" access_log|grep successful-ok|wc
  132288

  [root at schlxs030 cups]# grep "Get-Jobs" access_log|grep successful-ok|wc
   86253

  [root at cups]# grep "Get-Printer-Attributes" access_log|wc -l
  284299

  [root at cups]# grep "Get-Printer-Attributes" access_log|grep successful-ok|wc -l
  279471

  [root at cups]# grep "Get-Printer-Attributes" access_log|grep -v successful-ok|wc -l
    5236
  # these last ones were also all 'client-error-not-found'


So, to answer my own question:

  677.036 requests in total                    in 7+ days (or 630.000 seconds)
  284.299 requests to "Get-Printer-Attributes" in 7+ days (or 630.000 seconds)
  132.769 requests to "CUPS-Get-Printers"      in 7+ days (or 630.000 seconds)
  132.288 requests to "CUPS-Get-Classes"       in 7+ days (or 630.000 seconds)
   86.253 requests to "Get-Jobs"               in 7+ days (or 630.000 seconds)


Or, to put it differently, the frequency of each request:

[root at cups]# time cut -d " " -f11 access_log|sort|uniq -c
  17547 -
     69 Cancel-Job
     79 CUPS-Add-Modify-Printer
     15 CUPS-Delete-Printer
 132291 CUPS-Get-Classes
  12583 CUPS-Get-Default
     29 CUPS-Get-Devices
     31 CUPS-Get-PPDs
 132782 CUPS-Get-Printers
      9 CUPS-Reject-Jobs
  86253 Get-Jobs
 305485 Get-Printer-Attributes
      9 Hold-Job
      5 Pause-Printer
  12057 Print-Job
      6 Purge-Jobs
      1 Release-Job
     29 Restart-Job
     10 Resume-Printer


So, I'm also asking myself now if this is 'normal':

 * We had 12.057 print jobs from Samba,...
 * ...but we had 11x that number of 'CUPS-Get-Printers' requests,...
 * ...and 25x that number of those for 'Get-Printer-Attributes'.

Probably Franz' suggestion to use "deadtime = 5" in smb.conf could help
here too.

Cheers,
Kurt

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list