I have had a bog standard, unmanaged p4, dedicated server for some time now, Ive never done anything to it. other than a monthly reboot to keep things in order. I have about 20-30 sites running on it. most are database driven and all of them work very well except a new site that's starting to be developed on it. its a celebrity photos site at the lag between page loads it awful, it loads the homepage fine but if you go to a page where there is a lot of celebrity images such as Jennifer Lopez it can take up to 10 seconds to go between page 1 and page 2. Can the server be better optimized for databases or do you think the script might be at fault? Its a hostgator server and i was told they are good for database driven site. Any ideas?
Why would the database be slow? Images aren't stored in the db i hope? What you should do is get lighthttpd to serve the images.
Image information is stored in the database, for example when you click on a celebrity name it needs to know home many pictures there are for that celebrity and how many pictures to display per pages, content is dynamically created not static, all this information is obtain by querying the database, i think its more script based problems than server problem so i will put a project up on scriptlance to get it fixed i think.
Agreed, there's no way a script like that should take a long time to execute. A simple; SELECT COUNT(`*`) FROM table WHERE CELEB=`J_LO` Code (markup): will take that server ~1/50th of a second. The script may be doing a lot of unecessary queries, which is slowing it down. Is there a debug mode with the script? It could give you some clues. Also, the images take a while to load, are they produced on-the-fly with ImageMagik or something? Good Luck! kma
There is a small resize script there that produces the smaller images, but essential it is just a scaled down version of the original image and it does not reduce the original file size. I am going to have to hire a programmer to sort this out as i am no good with databases. If anyone can help with the script for a reasonable fee please PM me if not i will get s project put on on scriptlance.
i can help with the speed, the best thing to do in your case is caching, there does not seem to be much if any dynamic content on the page that can't be cached. i can implement a caching system for you.
I definitely agree with ndreamer - It should be resized into a cache image on the first load (or even before) and then loaded from the cache until the image is changed or deleted.
When the picture is uploaded it should have been resized. And then database just have to contain names on the files and a name of the person. This should not create a load like you are talking about.
If you are sure that the database queries are optimized and still you are facing slow database requests, then you should have to optimize mysql service configuration by modifying my.cnf file.