PPD: Message Processing Bottlenecks #4075

Closed
michaelrsweet opened this Issue May 10, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented May 10, 2012

Version: 1.6-current
CUPS.org User: chulbert

The currently recommended approach for encoding binary data in PPD files through PPD: messages from a filter suffers serious performance issues when the amount of data becomes large. Even more so when the PPD file is large.

Each PPD: message causes the PPD file to be read by line and written to a copy. If a filter emits 10s or 100s of messages this can result in 10s or 100s of megabytes of disk access, which can make the scheduler non-responsive. On OS X, this can lock the application and deny service to concurrent users.

While concise encoding, compression and multiple attributes per PPD: message help reduce the impact, the problem remains unsolved.

Collaborator

michaelrsweet commented May 23, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented May 23, 2012

"str4075.patch":

Index: scheduler/job.c

--- scheduler/job.c (revision 10492)
+++ scheduler/job.c (working copy)
@@ -3363,6 +3363,21 @@
cupsArrayRemove(PrintingJobs, job);

/*

  • * Apply any PPD updates...
  • */
  • if (job->num_keywords)
  • {
  • if (cupsdUpdatePrinterPPD(job->printer, job->num_keywords, job->keywords))
  •  cupsdSetPrinterAttrs(job->printer);
    
  • cupsFreeOptions(job->num_keywords, job->keywords);
  • job->num_keywords = 0;
  • job->keywords = NULL;
  • }
  • /*
    • Clear the printer <-> job association...
      */

@@ -4827,18 +4842,10 @@
* Set attribute(s)...
*/

  •  int      num_keywords;   /\* Number of keywords */
    

- cups_option_t keywords; / Keywords */

   cupsdLogJob(job, CUPSD_LOG_DEBUG, "PPD: %s", message);

- num_keywords = cupsParseOptions(message, 0, &keywords);

  •  if (cupsdUpdatePrinterPPD(job->printer, num_keywords, keywords))
    

- cupsdSetPrinterAttrs(job->printer);

  •  cupsFreeOptions(num_keywords, keywords);
    
  •  job->num_keywords = cupsParseOptions(message, job->num_keywords,
    
  •                                       &job->keywords);
    

    }
    else
    {
    Index: scheduler/job.h

    --- scheduler/job.h (revision 10492)
    +++ scheduler/job.h (working copy)
    @@ -80,6 +80,8 @@
    void profile; / Security profile /
    cups_array_t *history; /
    Debug log history /
    int progress; /
    Printing progress */
  • int num_keywords; /* Number of PPD keywords */
  • cups_option_t keywords; / PPD keywords */
    };

typedef struct cupsd_joblog_s /**** Job log message ****/

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment