Closed AblionGE closed 1 month ago
There is the PPD file of my printer in CUPS 2.4.10 PPD_file.txt
Hi @AblionGE ,
cupsd is not the only process running during printing, especially if you use PCL XL driver - ghostscript between Debian stable and Ubuntu 24.10 is 10.0.0 and 10.03.1 and ghostscript is used for PCL XL generation, so I suspect there can be a change.
Can you enable your debug2 logs in CUPS, get the gs command line used for your job, get the input file for gstopxl filter (in general take job file - starts with 'd' - matching with job from /var/spool/cups, and call universal filter with PPD, CONTENT_TYPE and FINAL_CONTENT_TYPE env variables - PPD is path to PPD file, CONTENT_TYPE is mime type of input file - here application/pdf, and FINAL_CONTENT_TYPE is mime type which should go out of the filter, here application/vnd.cups-pdf - and call it like "/path/to/universal 1 user '' 1 '' /var/spool/cups/file > output") and then call gs with the almost same options (you change input file from stdin to your file, and "-dOutputFile" from stdout to your new file) and universal filter output and see if it takes more time or output is larger than in Debian.
Either way, we need debug2 logs from both machines, files from /var/spool/cups (starts with d) from both machines, but IMO this is not CUPS issue. Maybe libcupsfilters one (if pdftopdf generates something bad - universal filter runs internally pdftopdf filter function, which is basically pdftopdf filter, but IMO there was no changes in PDF filtering), but I bet more on ghostscript change.
Additionally, PXL in general is slow when processing big PDFs - if it is something like barcode in PDF format, it can work ok, but normal PDF document printing creates really large files in comparison to the input PDF. I would recommend changing the driver if your use cases are more in line with common office printing and not delivery company label printing.
Hi @zdohnal ,
Thanks for the fast response!
I'm configuring CUPS to print barcodes in PDF format so the driver should be fine. I already played with other drivers but the slowness was still there.
I think you pointed the right culprit.
D [18/Oct/2024:06:40:02 +0000] [Job 1] Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=%stderr -sOutputFile=%stdout -r600x600 -dMediaPosition=5 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sDEVICE=pxlmono -I/usr/share/cups/fonts -c \'<</.HWMargins[12.000000 12.000000 12.000000 12.000000] /Margins[0 0]>>setpagedevice\' -f -_
Note:
-c \'<</.HWMargins[12.000000 12.000000 12.000000 12.000000] /Margins[0 0]>>setpagedevice\' -f -_
from the gs
command$ export PPD=/etc/cups/ppd/myprinter.ppd; export CONTENT_TYPE=application/pdf; export FINAL_CONTENT_TYPE=application/vnd.cups-pdf; /usr/lib/cups/filter/pdftopdf 1 CUPS-user '' 1 '' /var/spool/cups/d00001-001 > output
DEBUG: pdftopdf: Last filter determined by the PPD: gstopxl; FINAL_CONTENT_TYPE: application/vnd.cups-pdf => pdftopdf will log pages in page_log.
DEBUG: PDF interactive form and annotation flattening done via QPDF
DEBUG: pdftopdf: "print-scaling" IPP attribute: auto
DEBUG: pdftopdf: Print scaling mode: Do not scale, center, crop if needed
After Cropping: 595.000000 842.000000 595.000000 842.000000
PAGE: 1 1
$ ls -lh output
-rw-r--r--. 1 root root 48K Oct 18 07:19 output
$ gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dShowAcroForm -sstdout=gsftdout -sOutputFile=gsoutputfile -r600x600 -dMediaPosition=5 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sDEVICE=pxlmono -I/usr/share/cups/font output
$ ls -lh gsoutputfile
-rw-r--r--. 1 root root 1.4M Oct 18 07:22 gsoutputfile
Note:
-c \'<</.HWMargins[12.000000 12.000000 12.000000 12.000000] /Margins[0 0]>>setpagedevice\' -f -_
from the gs
commandD [18/Oct/2024:06:44:09 +0000] [Job 1] cfFilterGhostscript: Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dUsePDFX3Profile -sstdout=%stderr -sOutputFile=%stdout -r600x600 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sDEVICE=pxlmono -dcupsManualCopies -I/usr/share/cups/fonts -sOutputICCProfile=sgray.icc -c \'<</.HWMargins[11.990551 11.990551 11.990540 11.990540] /Margins[0 0]>>setpagedevice\' -f -_
$ export PPD=/etc/cups/ppd/myprinter.ppd; export CONTENT_TYPE=application/pdf; export FINAL_CONTENT_TYPE=application/vnd.cups-pdf; /usr/lib/cups/filter/universal 1 CUPS-user '' 1 '' /var/spool/cups/d00001-001 > output
DEBUG: ppdFilterLoadPPD: Color profile qualifier determined from job and PPD data '..600dpi'
DEBUG: ppdFilterLoadPPD: No ICC profiles specified in PPD
DEBUG: ppdFilterLoadPPD: Searching for profile "600dpi/-"...
DEBUG: ppdFilterLoadPPD: Last filter determined by the PPD: gstopxl; Final data MIME type: application/vnd.cups-pdf => PDF filter will log pages in page_log.
DEBUG: ppdFilterUniversal: "*cupsFilter(2): ..." lines in the PPD file:
DEBUG: ppdFilterUniversal: application/vnd.cups-raw application/octet-stream 0 -
DEBUG: ppdFilterUniversal: application/vnd.cups-postscript 100 gstopxl
DEBUG: ppdFilterUniversal: PPD uses "*cupsFilter: ..." lines, so we always convert to format given by FINAL_CONTENT_TYPE
DEBUG: ppdFilterUniversal: Converting from application/pdf to application/vnd.cups-pdf
DEBUG: cfFilterUniversal: Converting from application/pdf to application/vnd.cups-pdf
DEBUG: cfFilterUniversal: Final output format for job: application/vnd.cups-pdf
DEBUG: cfFilterUniversal: Adding pdftopdf to chain
INFO: cfFilterChain: Running filter: pdftopdf
INFO: cfFilterChain: pdftopdf (PID 130) started.
DEBUG: cfFilterPDFToPDF: Forced page logging selected by options.
DEBUG: cfFilterPDFToPDF: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...
DEBUG: cfFilterPDFToPDF: "print-scaling" IPP attribute: auto
DEBUG: cfFilterPDFToPDF: Print scaling mode: Do not scale, center, crop if needed
DEBUG: cfFilterPDFToPDF: After Cropping: 595.000000 842.000000 595.275574 841.889771
PAGE: 1 1
DEBUG: cfFilterChain: pdftopdf completed with status 0.
INFO: cfFilterChain: pdftopdf (PID 130) exited with no errors.
$ ls -lh output
-rw-r--r--. 1 root root 48K Oct 18 06:54 output
$ gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dUsePDFX3Profile -sstdout=gsftdout -sOutputFile=gsoutputfile -r600x600 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -sDEVICE=pxlmono -dcupsManualCopies -I/usr/share/cups/fonts -sOutputICCProfile=sgray.icc output
$ la -lh gsoutputfile
-rw-r--r--. 1 root root 9.0M Oct 18 07:05 gsoutputfile
Indeed, the output file from Ghostscript is much bigger on Ubuntu 24.10... So I guess that I should check on Ghostscript side?`
Thanks for the help!
Yep, please try - do let us know if GS upstream finds out there is an issue we have to fix in filtering - the code for that is in OpenPrinting/libcupsfilters, so if there is an issue about filtering, let us know there.
Closing for now, we can reopen later if needed.
Description
I'm building a Docker image with cups to print to network printers.
With the base image
debian:stable-slim
(and CUPS 2.4.2), the performances are acceptable. Withubuntu:24.10
(CUPS 2.4.10), the printing of every job is very slow.To Reproduce
Steps to reproduce the behavior:
docker build -t cups-docker .
And the entrypoint file:
docker run -d --rm --name cups -p 631:631 -e CUPS_ADMIN_PASSWORD=12345678 -e ENV=$ENV -e SERVER_FQDN=$FQDN cups-docker:latest
Expected behavior
With both CUPS version, I expect to have similar performances
Actual behavior
On ubuntu 24.10 with CUPS 2.4.10, each job takes several seconds to print (even if it's just one page).
I put the logs in
debug2
level and they are similar between both images except that with CUPS 2.4.10 I have ~10 more logs "Wrote XXXX bytes of print data...".I also checked the PPD file for my printer between both tests, they are the same. But at "runtime", I have this
CUPS 2.4.2
And on CUPS 2.4.10
I don't know if it makes a difference or not.
System Information: