Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kim Hansen 63 posts 144 karma points
    Jan 23, 2012 @ 23:39
    Kim Hansen
    0

    Performance problem

    Hi

    Ive got a problem with my site using Imagegen.

    Ive got about 80 images that needs to be resized using Imagegen.

    The first time i load the page i understand its using alot of CPU time, but when i reload its still using 100% CPU time for a few seconds.

    Can i do some tweaking to make it run more smooth?

    Thanks

    Kim

  • Kim Hansen 63 posts 144 karma points
    Jan 23, 2012 @ 23:48
    Kim Hansen
    0

    This is my XSLT

                              <xsl:element name="img">
                                <xsl:attribute name="src">
                                  <xsl:value-of select="concat('/ImageGen.ashx?image=/images/news/', orgImageID, '.jpg&amp;width=418&amp;height=276')" />
                                </xsl:attribute>
                                <xsl:attribute name="border">0</xsl:attribute>
                              </xsl:element>

    And my 3.0.3 config

    <ImageGenConfiguration>
        <Registration>
            <!-- ImageGen Professional is always available on localhost and *.local domains -->
            <Key domain="example.com">436DA8888A3BBC98662B23C6D1B635543E762854</Key>
            <Key domain="sample.com">55FD8FD97A199AB3082BC7DC11AE5F743B092C55</Key>
        </Registration>
        <HideDomains>false</HideDomains>
        <RemoteDomainWhiteList>
            <Domain>www.sample.com</Domain>
        </RemoteDomainWhiteList>


        <!-- NAMED CLASSES, INCULDING THE SPECIAL 'DEFAULT' CLASS -->
        <Class Name="default" OverridesQueryString="true">
            <AllowUpsizing>true</AllowUpsizing>
            <MaxHeight>800</MaxHeight>
            <MaxWidth>800</MaxWidth>
        <AltImage>/images/news_default.jpeg</AltImage>
        </Class>
    </ImageGenConfiguration>

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jan 24, 2012 @ 10:41
    Douglas Robar
    0

    Hi, Kim,

    What happens is the 80 images on your homepage will make 80 requests to imagegen.ashx. ImageGen will resize each according to your height/width and other parameters. Those resized images will be saved to the server's drive, the index.xml file(s) will be updated, and the resized images will be sent to the website visitor. Resizing can be a cpu and memory intensive task, especially if the original images are very large. But it only happens once for each unique set of height/width and other parameters.

     

    Once ImageGen's cache is primed, any future requests will find the cached file, update the associated index.xml file, and send the already-cached image to the website visitor. This is less cpu-intensive but like all website activity opening 80 http requests and sending the data down the pipe may be a load on the server for a moment, depending on the server's robustness. ImageGen is adding very little to this overhead than if you'd requested the images from the filesystem directly, but 80 nearly simultaneous requests for each website visitor can add up even for static resources.

     

    Or, if the website visitor has already downloaded the images from a previous visit to the site, ImageGen will respond with a 304 Not Modified response to the requests and bandwidth will be reduced to nearly zero for each request. Apart from the momentary burst of 80 requests and 80 304 responses. 

     

    Finally, if you are using ImageGen Professional, you can set a CachingTimeSpan value for a class of images and the visitor's browser won't even request the image again from your server for that time period, totally eliminating the 80 requests and 304 responses once the visitor gets the images initially. No activity on the server means zero load on the server. You can always try the ImageGen Professional features by running on localhost or any *.local domain before purchasing a key for your live domain.

     

    cheers,
    doug. 

  • Kim Hansen 63 posts 144 karma points
    Jan 24, 2012 @ 14:01
    Kim Hansen
    0

    Hi Douglas

    Thanks for your reply :)

    Your answer makes perfectly sense, but there is something wrong.

    Ive tried to make some timings on generating images with 2.5.7, and on our 2008 server (not R2) it takes 600ms to generate and view a medium sized image.

    Then i uninstalled 2.5.7 and installed 2.5.2, and now it says 13ms when generating and 3-5ms when viewing.

    /Kim

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jan 24, 2012 @ 14:04
    Douglas Robar
    0

    Now that *is* interesting! Time to review my 'enhancements' to find where I introduced such a slow down. Thanks!

    cheers,
    doug. 

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jan 25, 2012 @ 11:06
    Douglas Robar
    0

    One question... when you unistalled 2.5.7 and installed the older 2.5.2, did you delete the cached folders? Also, are the cached folders very large (or the index.xml file in them)? Massive folders or index.xml files will slow things down somewhat; though I shouldn't think as much as you're seeing.

    Let me know.

    cheers,
    doug. 

  • Kim Hansen 63 posts 144 karma points
    Jan 25, 2012 @ 11:36
    Kim Hansen
    0

    Oh, i really cant remember if i did remove the cached folder (not using Media), but i have tried to remove it when using 2.5.7 with no change.

    I just checked the size on the content and index.xml and they are 123MB / 665KB

  • Kim Hansen 63 posts 144 karma points
    Jan 25, 2012 @ 11:39
    Kim Hansen
    0

    I could try to delete cache, uninstall 2.5.2 and install 2.5.7 again, to see if there is any changes.

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jan 25, 2012 @ 11:41
    Douglas Robar
    0

    It might be a worthwhile baseline. If you have the opportunity I'd appreciate it. Always good to find how things operate in the wild and not just on my servers when testing.

    cheers,
    doug. 

Please Sign in or register to post replies

Write your reply to:

Draft