Forum Moderators: phranque

Message Too Old, No Replies

high load on server

high load on server

         

adnanp78

11:28 am on Jun 19, 2007 (gmt 0)

10+ Year Member



I get this massage from abuse admin:
Due to high load on server Gator242 we had to disable the myfolder directory to prevent further load on the server. Below are the logs, Thanks.

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

jdMorgan

2:46 pm on Jun 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I have a php script there in real time resize photos to 800px.

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]

adnanp78

6:37 pm on Jun 20, 2007 (gmt 0)

10+ Year Member



Yes, YOu talk great, its true and this is reason to hostgator ban me. I ruturn my script to old scenario (no resize, direct link) and said thet i will in middle time optimize my script. Its one big site with about 1000 comics (every comicst have about 100 400-16000px pictures) ;) I have no more spirit to play with so one big projest and risk to one more ban (finaly) I change mind and think about some client side resize methode (DHTML, Flash..) In every case, thx jdM ;)