CGI App - Scaling issues with speed and memory usage

Hi All

We have a web app that is ramping up and we’re running into scaling issues. Any comments would be greatly appreciated.

Right Now
We have a XOJO CGI app that reads ~1MB images fromMySQL DB and serves them up directly through the app - displayed directly in a WebImageView.

(The database has 10,000+ images for round figures, and each user might need to access 30 of them in a typical session)

This was easiest to build (for us) and programatically it behaves just fine BUT it’s slow to load and very memory intensive.

We’ve considered a couple of options but for the most part they boil down to the following.

Serving the images as flat files via Apache (using the URL property)

As we understand it, that will load fast, reduce memory usage from the CGI app and cache locally on the client, right?

If so the only obstacle for that approach is keeping the images secure, how could we secure them in a flat file system but also get the benefits mentioned above?

Thanks for being a sounding board!

You could use a CDN service which provides secure URLs. Check out the Rackspace Cloud Files service.

You could keep two copies of the images — one smaller/watermarked image for thumbnails, then a full size image that is downloaded once the customer has made up their mind/purchased it.

The URL option is good since it offloads the processing to the web server, especially if they re-view the graphic multiple times. For this, I often create a folder with a date-time stamp in its name. That way, each time I go to cache a new image, I purge old cached image files that are in a folder with a name older than, say, two hours. This reduces the chance of Google’s spiders finding them too.

[quote=114840:@David Cox]You could keep two copies of the images — one smaller/watermarked image for thumbnails, then a full size image that is downloaded once the customer has made up their mind/purchased it.

The URL option is good since it offloads the processing to the web server, especially if they re-view the graphic multiple times. For this, I often create a folder with a date-time stamp in its name. That way, each time I go to cache a new image, I purge old cached image files that are in a folder with a name older than, say, two hours. This reduces the chance of Google’s spiders finding them too.[/quote]

A Xojo app cannot be spirered, normally. So that is an advantage in this instance, because images.google.com will not be able to plunder the picture files.

Your idea of a short lived images folder is great. It also prevents the user to bookmark the file, while preserving the advantage of the URL pictures.

Thank you David.