Print PDF Painfully Slow

Any idea as to why the Print PDF function would take a very long time to load. It does eventually download the pdf and the formatting is correct, but it used to be almost instantaneous. Now it sits and loads for 1-2 minutes before downloading. Its a very small document.

Thanks

Please tell us your version of SuiteCRM, and check both your logs for any errors at that time.

7.9.7

No errors

No errors on both suitecrm.log and php_errors.log?.. that’s strange.

And on your browser’s web console? Any Javascript errors? What about the tab to see network delays, does it give you any clues about whether some request to the server is taking very long?

No errors in either log. None in console. PDF Prints in the end just fine. Just takes forever to do so. No slow network warnings either. The rest of the system runs plenty fast. Yes…very weird. Just started randomly. Was fine 2 days ago. Going to check and see if Linux pulled an update but I doubt it.

I am guessing it might be a problem with your PDF app. Maybe you can check in the Process Viewer (or “top” on command-line) if it launches the PDF viewer immediately, but then the viewer takes all that time to load.

Finally drilled down to the issue. It only happens with an Image attached. Image is tiny and shows fine in both the editor and when the print finally downloads. Print is instant without the picture in the template, and up to a few days ago now, was instant with the picture in the template.

Its getting weirder

You can try to figure out if it’s a network request that has to timeout before opening the file proceeds. If you have some network monitoring software, or use netstat, you might discover something.

I am having this problem too. When I was in 7.6.6, print to PDF was near-instant. After upgrading to 7.10.13 (long story and not the most normal journey) one of the only things that’s not working ‘normally’ is this.

However, mine is really strange because the speed is perfect when I ‘download to pdf’ from Reports, but when I ‘print to PDF’ from the quotes module it’s a lot slower.

Why would that be?

There are images in both. Perhaps the size of that image is too big in the quotes one… let me check this…

I would love to solve this because the rest is so good.

Any suggestions on how I can troubleshoot this? It takes about 13 to 15 seconds before I can download the PDF after clicking print to pdf.

thanks!

here are some errors from my shared hosting. i’ve stripped out identifying items but left what I think might be relevant to my problem.

Thanks!

============

PHP Notice:  A non well formed numeric value encountered in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 31983, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  A non well formed numeric value encountered in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 31990, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  A non well formed numeric value encountered in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 31990, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  A non well formed numeric value encountered in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 31990, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  A non well formed numeric value encountered in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/mpdf.php on line 31990, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TD>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TD in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TD>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TD in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TR>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TR in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TR>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TR in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TBODY>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TBODY in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TBODY>>ID>> in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 1011, referer: https://mydomain.com/crm/index.php?action=ajaxui
PHP Notice:  Undefined index: TBODY in /home/myusername/public_html/mydomain.com/crm/modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php on line 966, referer: https://mydomain.com/crm/index.php?action=ajaxui

Have you searched GitHub? I have seen this PHP Notice in PDF’s before, I am not sure if there is an issue for it yet :huh:

Maybe the notice is associated with the delay, but that would be strange. There’s no reason to think a PHP notice could cause such a delay.

Maybe one of you can try increasing log levels to DEBUG and then run this while trying the PDF generation:

tail -f suitecrm.log

You will see a live log of what is happening, and you can hit return a few times to leave blank lines. If you notice any human-discernable delays, hit return to mark the place, and then go back to it to see what was happening.

I would totally do that, except I’m on a shared host.

a lot of my struggles are because of this but, on the other hand, I think I’ve been leaving a lot of ‘help’ for others like me so hopefully community in general benefits from my cpanel suitecrm life! :slight_smile:

I can easily access the log though… once it is written as per above.

I also had other issues with indexing recently (Global search was broken). I followed (and then re-wrote) a re-indexing tutorial and fixed that the other day. I wonder if there could be a delay related to suitecrm not knowing (quickly enough) where all the files are located… seems strange but it’s the only current problem I know of on my system. The rest is working really well.

Another interesting observation is that during the day the delay was about 12 seconds but then at another point last night it was only about 6 seconds.

Could the delay be caused by the CPU being bogged down by running a cron job for example? I wonder I’m running out of RAM because of other server processes…

There are shared hosts that allow SSH access so you get a proper console (with some limitations, of course). This doesn’t really add to the costs - some providers just have that feature, that’s all.

I would never attempt to run a SuiteCRM installation without a console…