Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i have a lamp server which runs php script. i use this script https://github.com/blueimp/jQuery-File-Upload/blob/master/example/upload.php which automatically uploads and resize the image to the defined resolution.

i have a problem now. a 5Mb file takes about 6 seconds to finish the full job. if i queue up 10 files for upload the server is not responding for other requests. and the both cores of the processor are at 100% use.

i have the full access to the server. what should i do to reduce the work load of the server. is the problem on the scripts or should i use any pluggins for resizing..

share|improve this question
2  
I think this has much better chances to be answered at stackoverflow or serverfault –  Sergey Sep 9 '11 at 11:16
add comment

1 Answer 1

up vote 1 down vote accepted

The PHP file you linked uses the imagecopyresampled function, which needs much cpu to do the work. You can use the function imagecopyresized instead, but the resulting quality will be worse then.

Depending on the destination size, you can combine these two, first reduce the pictures size by imagecopyresized half of its size, and use then imagecopyresampled to reduce the size to its final size. This should end in a similar quality as if you would have done it in one step using imagecopyresampled

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.