Welcome to WebmasterWorld Guest from 54.167.78.17

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

phpThumb is killing my server. Help

     
7:28 pm on Oct 22, 2010 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 16, 2006
posts:397
votes: 1


I'm using phpThumb to generate thumbnails. it worked grate for 4 years since a few days ago when it started to kill my server.

the server load goes through the roof.

i didn't make any changes to the script or to anything on the site, and the traffic did not get higher. however, over night phpThumb is using almost all my CPU

the cache in phpThumb is working

please help. I'm getting desperate.

anyone else enountered this problem?
8:42 pm on Oct 22, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 24, 2005
posts:697
votes: 0


is any process stuck ? did you restart your server? is there a huge image to create a thumbnail of ? that might be causing the script to hang
9:33 pm on Oct 22, 2010 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 16, 2006
posts:397
votes: 1


no process stuck. i did restart the server and the problem continued and no large image
9:43 pm on Oct 22, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


I remember that class it keeps a cache of images and no auto-cleanup if I remember correctly. You will have to clean up the thumbs manually (there should be a cache folder under phpThumb). What I don't understand though is that the thumb files must be accessed for the server load you describe.

If some traffic is causing it you may want to implement cold image linking where the images are outside the web-root and an intermediate server script accesses them and randomizes the image link so images cannot hot-linked.
10:32 pm on Oct 22, 2010 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 16, 2006
posts:397
votes: 1


the cache cleans out ok.
what i dont understand is this:
if it has worked for 4 years without trouble
i haven't changed anything in my site's code
i haven't changed anything at phpthumb
the traffic is the same

why is it causing such high server load?

i think it might be a php setting of some sort...maybe the people at my hoting server changed something (it's a deducated server)
9:43 am on Oct 23, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


Can you check the dates of the thumbs? Are they recreated on every request for some reason?
11:16 am on Oct 23, 2010 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 16, 2006
posts:397
votes: 1


nope. i'm almost certain the cache works fine.
i'm wondering if it could be a server or php setting of some sort
can you think of anything of this type?
5:06 pm on Oct 23, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


make a test php script on the server do

echo get_cfg_var('memory_limit');

what's the memory limit?
11:19 am on Oct 25, 2010 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 16, 2006
posts:397
votes: 1


solved it...it was not phpthumb. it was imagemagick and the problem was i had two versions installed on my server