forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: prodigious on October 06, 2004, 05:24:26 pm

Title: CPU Usage issues when uploading and resizing pictures
Post by: prodigious on October 06, 2004, 05:24:26 pm
Hello..

So while using 1.3.1, I ended up getting my account suspended because I had caused a 32% CPU Usage on my server.  My TOS calls for no more than 6% so I wanted to know if any of you also had issues with this.     I was uploading pictures using the normal upload interface (not batch add) and I was resizing the pictures once they were uploaded.

Any thoughts on how I can keep using Coppermine's features but keep CPU Usage down within acceptable limits?

Thanks
Mike
Title: Re: CPU Usage issues when uploading and resizing pictures
Post by: Tranz on October 06, 2004, 06:44:59 pm
Were you using files at the original size from the camera? How many files?
Title: Re: CPU Usage issues when uploading and resizing pictures
Post by: prodigious on October 06, 2004, 08:17:36 pm
Yes, the files were the original size;  5 files at a time.   I believe the files were at least 1600 x 1200 originally.
Title: Re: CPU Usage issues when uploading and resizing pictures
Post by: kegobeer on October 06, 2004, 08:42:45 pm
The problem lies with GD or ImageMagick, and the CPU cycles they consume during the resize process.  The easiest (and best) way to keep this low is to resize the images prior to upload (I resize mine to 640x480) and drop the resolution to a more web happy level.

Both GD and ImageMagick are CPU intensive apps - there's no real workaround for that.  You could limit uploads to one file at a time, tell your users to put some time between uploads, prevent images larger that 1024x768 from being uploaded, or have your users try using xp_publish.php (which uses the built in XP upload ability) which can resize the images before being uploaded.