Forum Moderators: phranque
Top Process %CPU 77.5 [php]
Top Process %CPU 76.5 /usr/bin/php index.php
Top Process %CPU 74.0 /usr/bin/php index.php
I have a php script there in real time resize photos to 800px.Every page have only one photo. Whan you can sugest me todo now. I'm on shared server (hostgator) I have about 40GB of photos and chnage host can make me a problem. Tnx
Change the script to write the resized image to disk. Before generating a resized image, it should check to see if the resized image exists on disk. If not, then generate it and write it to disk. If it already exists, grab it from disk and output it.
This avoids the need to resize the same image again and again, which is what is apparently loading your server.
If you should need to change the image, simply replace the full-sized image, delete the resized image from the disk, and your modified script will then generate a new resized image the first time it is requested.
This is essentially making a 'resized image cache' on disk to avoid having to resize the same image repeatedly.
Jim
[edited by: jdMorgan at 2:46 pm (utc) on June 19, 2007]