I'm developing a web application, and using a typical lamp stack. I'm using dompdf to generate some reports to pdf. In one case, I have a simple table list (think list of clients) with some simple info (name, phone number, email, etc...) but the user has close to 400 clients in this list. When trying to render the report to pdf, the Allowed memory size is exceeded and an error occurs. My question is how do I approach a solution to this? If one user running a report is eating all my cpu, I can only imagine this when 100's are users try and run reports at the same time on the production server (rackspace cloud server)
The exact error is:
[Wed Apr 24 01:06:54 2013] [error] [client 127.0.0.1] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 83 bytes) in /home/redacted/redacted/v2/application/libraries/dompdf/include/style.cls.php on line 863, referer: http://redacted.v2/reports
Do I need to spawn a separate process for each report run? I'm not exactly sure how that's done (I guess I would need to do this via PHP). Basically I don't want my server to come to a screeching halt any time a large report gets run. Any thoughts or advice is much appreciated!