[nycphp-talk] file_get_contents() with a context

Donald J. Organ IV dorgan at
Sat Aug 14 20:25:38 EDT 2010

I guess my biggest problem is with http 1.0 and multiple simultaneous connection i can process 2,000 images in about 13 seconds.

with http 1.1 it is taking anywhere from 8-15 seconds per image.  for lets say 10 seconds.

so on 2,000 images that would take approx. 5.5 hours.

Now if i cut that down and did 10 at a time with something such as curl_multi or forking scripts.  it would still take 30 minutes.

Now 30 minutes I guess isnt that bad for 2,000 images but say i have to do 1 magnitude higher than that and had to do 20,000 thats back up to 5 hours.

Maybe the question is...If a customers site is running on shared host what would be an acceptable number of simultaneous connections to do this would 10 be OK , and if so how about 20? and if so how about 30?  And would it matter based on the host?

I know the easy solution to this is to have the customer send us a DVD and process the images this way...but that assume that the customer is capable and even has the knowledge to do so.

Suggestions/comments and anything else is welcome.

I guess the BIGGEST question of all is why does it take 10 seconds to process an image when using http 1.1 but less than a second when using http 1.0, and can this be fixed?

----- Original Message -----
From: "Dan Cech" <dcech at>
To: talk at
Sent: Friday, August 13, 2010 4:39:10 PM
Subject: Re: [nycphp-talk] file_get_contents() with a context

I'd be looking into cURL and specifically curl_multi, or forking a bunch
of sub-processes so that each one can maintain its own connection and
process a portion of the requests.

New York PHP Users Group Community Talk Mailing List

More information about the talk mailing list