CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DOMPDF Eating up CPU
Pages: [1] 2 3

Author Topic: DOMPDF Eating up CPU  (Read 15368 times)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
DOMPDF Eating up CPU
May 04, 2011, 12:43:27 pm
On a Drupal 6 site that was just upgraded to CiviCRM 3.4, when someone registers for an event, the process eventually dies on a 500 error. We investigated it, and identified that the problematic module is DOMPDF. It appears to hang without being able to complete successfully.

There is an xdebug.txt file here civihosting.com/sites/default/files/xdebug.txt.zip if anyone wants to have a look at it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DOMPDF Eating up CPU
May 04, 2011, 01:22:49 pm

This has come up a few times and would be great if someone can help provide a patch to make the PDF generation and receipt attachment optional. it should not be too hard to do so (maybe a 4-8 hour project)

sorry, i dont think any of us know a lot about DOMPDF to help in that. the dompdf forums might be a better place

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DOMPDF Eating up CPU
May 04, 2011, 02:35:54 pm
Hershel, I dug into this a bit (before giving up once) but got the impression that your html matters a lot to dompdf - I think that it has to calculate column width on the tables & loads up all the pdf data before it can start on that.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DOMPDF Eating up CPU
May 04, 2011, 02:36:32 pm
nb - same template - different civi version stopped it working?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DOMPDF Eating up CPU
May 05, 2011, 03:01:39 am
Quote from: Eileen on May 04, 2011, 02:36:32 pm
nb - same template - different civi version stopped it working?

Correct. I think they were using registrations in the previous version. I'm pretty sure.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: DOMPDF Eating up CPU
May 05, 2011, 04:31:53 am
Might be worthwhile asking in dompdf forums/mailing list. Presumably they know the best practice and what to do/not to do to avoid using too much memory?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DOMPDF Eating up CPU
May 05, 2011, 04:36:27 am
I posted an issue there.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: DOMPDF Eating up CPU
May 08, 2011, 06:34:42 am
I'm really intrigued by the potential of this new Drupal PDF module, epspecially the savings of  not rendering much of the page on each receipt due through template merging:  http://drupal.org/project/views_pdf
Lead Developer, C3 Design.
Twitter: @FatherShawn

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DOMPDF Eating up CPU
May 11, 2011, 10:32:36 am
They posted a response at http://code.google.com/p/dompdf/issues/detail?id=277 :

Quote
Would you be able to update to the latest 0.6.0 beta? Lots of changes have been made since the Helmut release.

If you can post a sample of the HTML being rendered that would help determining what's going on. Just FYI, the most typical cause of 500 errors on simple documents is a table cell larger than a single page.

We'll take a look at the xdebug.txt when we get a chance to see if there's anything of note.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DOMPDF Eating up CPU
May 11, 2011, 01:28:09 pm

hershel:

can u do a local upgrade to 0.6.beta on your civicrm packages directory and see how it goes

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DOMPDF Eating up CPU
May 16, 2011, 10:34:48 am
Tried that but unfortunately didn't solve the problem. :(
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DOMPDF Eating up CPU
May 16, 2011, 11:19:54 am

any interest from anyone to submit a patch that makes the PDF attachment optional for event reg / contributions. To begin with it could just be a global configuration option that is enabled by default, but can be turned off.

At a later stage, would be nice to make it a setting for all "public" pages that send an email. But that will require a DB change and is a wee bit more complex

We can help u'll out with this patch on IRC. A great easy project to get started with

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DOMPDF Eating up CPU
May 16, 2011, 11:59:04 am
The dompdf guy said

Quote
DOMPDF 0.6.0 will return the working HTML document as a string if you call $dompdf->output_html().

Can you tell me whereabouts I could do that and I will try ? Perhaps that could help point us in the direction, in the meantime. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DOMPDF Eating up CPU
May 16, 2011, 01:00:26 pm

CRM/Core/BAO/MessageTemplates.php, function sendTemplate

search for PDFFileName

Seems like sending a PDF receipt might be more easily encapsulated as a column in the message template table

You can add a config variable in the Admin screens, maybe under:

CRM/Admin/Form/Setting/Miscellaneous.php. But maybe fixing message templates schema might be a better thing to do

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

majortom

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 0
Re: DOMPDF Eating up CPU
May 18, 2011, 07:17:53 am
Hershel -
   Have you figured out any work around? Does upgrading to drupal 7/CiviCRM 4 fix the problem?

Pages: [1] 2 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • DOMPDF Eating up CPU

This forum was archived on 2017-11-26.