[nycphp-talk] memory problems
Donald J. Organ IV
dorgan at donaldorgan.com
Thu Jun 4 12:00:27 EDT 2009
Do you mind sharing the script?
----- Original Message -----
From: "Rahmin Pavlovic" <rahmin at insite-out.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Thursday, June 4, 2009 11:48:40 AM
Subject: [nycphp-talk] memory problems
Heya,
So, I have this script that does the following:
1. Requests jpeg from origin CDN via cURL
2. If file doesnt exist... log error, continue.
3. Write jpeg to temp file
4. Resize original image (GD lib) to temp file. FTP to directory on
new CDN. Create directory structure if not present. Repeat seven
times per image.
Not sure how many, but we're talking about 10k; maybe 15k images.
The script works, but problem we're running into is the memory limit.
We got about 31% through the images, and hit:
PHP Fatal error: Allowed memory size of 524288000 bytes exhausted
(tried to allocate 41760 bytes) in /web/lib/php/populate_images.php on
line 135
Maybe it's me, but if we have to allot more than 500 MB of memory,
something is wrong.
Any ideas? Maybe sleep the script after each image?
We're running the script in shell.
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/show_participation.php
More information about the talk
mailing list