Lunarpages Web Hosting Forum

Author Topic: Question About CPU Limits  (Read 4534 times)

Offline bdaniel

  • Trekkie
  • **
  • Posts: 16
Question About CPU Limits
« on: February 05, 2010, 04:43:18 AM »
Photography is a big hobby of mine and I have about 12,000 photos on my site that I share with friends and family. I average less than 1000 visits per month. I also like to play with Google maps and overlaying my photos on maps using GPS coordinates. I have about 5 different sizes of each photo to use in various ways from a small thumbnail to the full size photo.

Currently I create the different photo sizes on my PC and upload to my site. I am using ImageMagick to create some simple graphics on my site and I also use ImageMagick to make the different size photos on my PC. So duh, it hit me, why not upload the full size photo to my site and use PHP/ImageMagick on my site to create the other size photos on my site instead of uploading them. I know I can do that, but here is my question.

What kind of CPU limits will I hit if I try to make 4 different sizes of photos from say 100 photos at one time. I do not want to negatively impact CPU resources for others or get my account suspended. Do I process a few photos at a time and take a 1 minute break?

Can someone give me some advice here?


Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6427
Re: Question About CPU Limits
« Reply #1 on: February 05, 2010, 08:14:05 AM »
If this is a one-time operation (for each photo), rather than resizing on the fly (each time a page is requested), you shouldn't run into too much trouble. Just to be nice to others, and avoid CPU load problems, I'd do one or two photos and then take a break for a minute. You could probably do more than that at once, but with no way to monitor your CPU usage (except by arrangement with support to have them tell you on a regular basis), why take the risk? As it's a one-time job, I'd just take the 4 days or so to do two photos per minute. To avoid having to be connected for that length of time (and hitting some time limit), you might want to run your script as a cron job -- say, fire it off every 2 minutes to do 4 photos, keeping track of where you are. The script might remove photos from one directory as they're processed and written to another directory, and just do the next photo in the source directory until it's empty.

If you don't want to do it on your PC because of all the labor involved, some image manipulation programs have scripting languages that may let you fire it off on your PC and it runs overnight. GIMP has such a language, but I've never used it. I wouldn't be surprised if Photoshop can do it too. You might be able to cobble up some sort of batch script (e.g., in Perl) to run your command-line batch conversion/scaling program non-stop against each photo file. Of course, you then have five times as many files to upload as the other way (but any good FTP client should be able to do more than one file at a time).
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-