cfimage processing slow

90 views
Skip to first unread message

Steve Onnis

unread,
Aug 8, 2012, 1:15:37 AM8/8/12
to cfau...@googlegroups.com
Does anyone one if the processes used behind the cfimage functions are single threaded?  Like, can it only process one image at a time?  I am having this issue where i am trying to launch multiple browsers to process some images to get it done faster but i still seems like everything is being queued and it doesnt matter how many processes i start, only one image is being processed at a time.

any ideas?

Steve

Josh Wines

unread,
Aug 8, 2012, 1:23:45 AM8/8/12
to cfau...@googlegroups.com
I wouldn't have thought it would block the other threads if your opening it in another browser. Have you tried using <cfthread> at all? Failing that perhaps looking at something like ImageMagick might help you out.

Josh

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cfaussie/-/eA-XnXEXYF8J.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Steve Onnis

unread,
Aug 8, 2012, 1:27:50 AM8/8/12
to cfau...@googlegroups.com
Could it be a browser this? Only being able to handle a certain number of requests at a time?  I set up a script where i embeded like 50 iframes onto a page with the url i am trying to process but it didnt seem to do much at all.

Zac Spitzer

unread,
Aug 8, 2012, 1:28:15 AM8/8/12
to cfau...@googlegroups.com
which version of CF?
> --
> You received this message because you are subscribed to the Google Groups
> "cfaussie" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cfaussie/-/jkoI7zrIFLwJ.
>
> To post to this group, send email to cfau...@googlegroups.com.
> To unsubscribe from this group, send email to
> cfaussie+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cfaussie?hl=en.



--
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168

Steve Onnis

unread,
Aug 8, 2012, 1:29:58 AM8/8/12
to cfau...@googlegroups.com
currently cf9

Zac Spitzer

unread,
Aug 8, 2012, 2:30:08 AM8/8/12
to cfau...@googlegroups.com
if it's slow, they are probably RGBA images

this might help

http://zacster.blogspot.com.au/2011/05/coldfusion-slow-imageresize-problem.html

z

On Wed, Aug 8, 2012 at 3:29 PM, Steve Onnis <st...@cfcentral.com.au> wrote:
> currently cf9
>
> --
> You received this message because you are subscribed to the Google Groups
> "cfaussie" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cfaussie/-/eGz7OD5Ayg8J.

Charlie Arehart

unread,
Aug 8, 2012, 9:07:18 AM8/8/12
to cfau...@googlegroups.com
Hey Steve, here are two thoughts about your challenge with image processing.

First, in case you or others may have wondered, image manipulation is NOT
among the features that are single-threaded in CF Standard due to the
"enterprise feature router" or EFR feature (which limits performance of some
tags in CF Standard as compared to CF Enterprise, by single-threading them).
This is discussed briefly on the CF9 feature comparison matrix:

http://www.adobe.com/products/coldfusion/pdfs/cf9_feature_comparison_matrix_
ue.pdf


Second, you don't mention it, but by any chance is the "processing" you want
to do image resizing? This is indeed a common source of frustration and
annoyance for many, and there may be very good news for you if that's the
problem you're hitting.

No one's mentioned it here yet, but for image resizing in CF (whether with
the CFIMAGE tag or imageresize function), the default interpolation value,
which is "highestquality", can be changed to "highestperformance", which
may make a great improvement without much loss of image quality. Test for
yourself to see.

One challenge is that changing this is not supported in CFIMAGE until CF10.
But in CF8 and 9 you can change to using the imageresize function, which
supports changing the interpolation as its 4th argument.

I discuss all this in more detail in a blog entry here:
http://www.carehart.org/blog/client/index.cfm/2012/5/28/cf_image_resizing_pr
oblem_and_solution.

Finally, I do realize that some resize problems are due to color level
issues like James mentions in his comment here. I'll note that Adobe says
they addressed this some in CF10 also (at least on OSX and 64-bit OS's), but
if anyone has an example for them that still performs poorly in CF10, I'm
sure they'd want to hear about it and address is if possible.

But back to Steve's original question here, I wanted to make sure that folks
having resize performance problems are at least aware of this interpolation
issue, since it's so easy to change and test. It's helped a lot of people
when I've been helping with image resize performance problems.

/charlie

Steve Onnis

unread,
Aug 8, 2012, 9:22:56 AM8/8/12
to cfau...@googlegroups.com
Charlie

Once again thank you for such an indepth response.

Yes the task i am performing is resizing, generating thumbnails of images.
I have about 12000 images that i am performing this task on and i have been
monitoring the folder that the generated thumbnails are being stored in. I
have been noticing that the number of images are increasing as the
thumbnails are generated but the increase seems to be but units of one or
two. I appreciate that the there will be a delay between when windows
updates its files in folder count which would explain the increment values.

What i then did was create a file that added 50 iframes each with the url of
the script that is performing the task. I would have assumed that doing
this would see the number of files in the thumbnail folder increase by
larger increments and a lot faster which does not seem to be the case. It
is like everything is being queued up and processed one at a time.

The only thing i can think of is that this isnt working because of a limit
of the number of simultaneous requests that the browser can handle. I have
tried this also using multiple browser windows with the same outcome.

Steve

Steve Onnis

unread,
Aug 8, 2012, 7:45:05 PM8/8/12
to cfau...@googlegroups.com
the actual operation is being done as fast as i would expect as some of the
files are a few Mb in size. the issue is that they seem to be getting done
one at a time

-----Original Message-----
From: Zac Spitzer [mailto:zac.s...@gmail.com]
Sent: Wednesday, 8 August 2012 4:30 PM
To: cfau...@googlegroups.com
Subject: Re: [cfaussie] cfimage processing slow

Blair McKenzie

unread,
Aug 8, 2012, 7:53:42 PM8/8/12
to cfau...@googlegroups.com
Does the job need to be done with ColdFusion? Even if this is an ongoing task, at the scale you're talking about I have to agree with Josh - ImageMagick would be better. Throwing to ImageMagick with CFEXECUTE separately for each image might be faster than CFIMAGE. It would definitely be faster for batch resizes.

Blair

Steve Onnis

unread,
Aug 8, 2012, 7:55:38 PM8/8/12
to cfau...@googlegroups.com

does that handle cmyk images?

Blair McKenzie

unread,
Aug 8, 2012, 8:11:01 PM8/8/12
to cfau...@googlegroups.com
Yes. ImageMagick is like the gold standard of image processing tools.

Charlie Arehart

unread,
Aug 9, 2012, 9:04:23 AM8/9/12
to cfau...@googlegroups.com
Thanks, Steve. As for your challenge, here's another thought: to find out
whether this is indeed about the image handling being single-threaded, or
your browser, how about changing the page you call to do a sleep(10000)
(which puts the CF thread to sleep for 10 seconds) and maybe do a CFLOG to
write when it's done. Then call it with your process that makes many
requests at once, and see if it writes only 1 at a time, every 20 seconds.
If so, then it shows that it is indeed your browser that's doing the
single-threading.

Most modern browsers do indeed implement such request limiting, and from my
experience it's related to concurrent page requests to a given domain/ip. If
you could call that server more than one way, you may see the number of
concurrent requests increase. If that was the problem and solution, and you
really needed to run multiple concurrent requests at once, you could use a
hosts file setup to create new hostnames pointing to the one server.

Finally, you mention opening "multiple browser windows", but that may not
have been able to help. For instance, if you may be running Firefox, it
executes new windows as being in the same FF process as other windows, and
so I suspect would apply this limit across them all.
Reply all
Reply to author
Forward
0 new messages