Solved

The cost of resizing images on the fly

Posted on 2009-03-31
2
246 Views
Last Modified: 2012-05-06
My predecessor created a website for a dealer in second hand luxury cars. It has a CMS and new offers are added by the site owner. The site includes many photos of the cars. In order to have visitors see an optimal size of the photos, almost every photos is resized on-the-fly before being displayed.

By studying the visitor stats, I found out that there are a couple of car forums where the users post photos using the page which resizes the photos. The bandwidth and resizing comes from the car site. The aspx-page which does the resizing is by far the most called page in the site, it is requested an order of magnitude more often then the next most-requested page.

The site sometimes gives an Internal Server Error, which is caused - as was told us by the company which hosts the site - by memory problems. We were told to check our scripts, I did a rough check, but nothing strange caught my eye. Then I looked at the stats and thought that the resizing of images on the fly was likely the cause of the memory problems. That is my gut feeling, but I have no hard numbers about the memory cost of resizing images on the fly.

Does anyone have some information to confirm my gut feeling?
0
Comment
Question by:sybe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Buginator earned 500 total points
ID: 24030992
Absolutely. If it's like you are describing, my best guess is that you are correct about your theory. Resizing images is a really expensive operation, and when your webserver does this on the fly everytime a user just browse your site, the resource hog must be enormous (of course depending on the popularity of your website). Remember that the images must be stored in RAM to get resized, and when you have many images multiplied with many users (clients)... I guess you understand the problem here.

So, an application, especially web applications,  should never need to resize the same images again and again. It should only do it maximum once.

If your situation is that there are no other ways to do this than resize them on the fly, then you should alter the site to use client resize instead, with css,  javascript, or xhtml, preferably the first one. But the downfall with this would of course be a bandwidth issue - your users need to download bigger images, which their browser resize anyways.

Ideally you would need to alter the code so that the server only resize each image one time.
0
 
LVL 28

Author Closing Comment

by:sybe
ID: 31564916
Thanks. Glad to have it confirmed.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question