npsari Posted April 27, 2008 Share Posted April 27, 2008 my website is very slow 50% of the day I now realized that when i connect to the mySQL database in my scripts, i do not close the connection at the end Do i have to close the connections in everypage Does that play a role in slowing down my site Should i open each page i have and close the connection Please let me know Quote Link to comment Share on other sites More sharing options...
Ne.OnZ Posted April 27, 2008 Share Posted April 27, 2008 It could also be your server ! Quote Link to comment Share on other sites More sharing options...
npsari Posted April 27, 2008 Author Share Posted April 27, 2008 But my server hosting company said that my server is fast Here are the details Do you think this server is fast Processor #1 Vendor: GenuineIntel Processor #1 Name: Intel® Pentium® 4 CPU 2.00GHz Processor #1 speed: 1992.756 MHz Processor #1 cache size: 512 KB Memory: 1034400k/1048512k available (2169k kernel code, 13236k reserved, 725k data, 172k init, 131008k highmem) Quote Link to comment Share on other sites More sharing options...
dptr1988 Posted April 27, 2008 Share Posted April 27, 2008 PHP automatically closes your MySQL connections for you unless you have specifically requested persistent connections, so it's not that. Have you checked if it's 'slow' bandwidth, or 'slow' server performance ( ie, SQL query or page generation performance )? Quote Link to comment Share on other sites More sharing options...
mrdamien Posted April 27, 2008 Share Posted April 27, 2008 Your server is fast enough for a couple of websites but not too many. It could also be another website on that server is taking up too many resources. You should ask your web host too see whats going on, or switch hosts :-/ Quote Link to comment Share on other sites More sharing options...
npsari Posted April 27, 2008 Author Share Posted April 27, 2008 Yes, i think i will have to move to a different company But that is strange i am checking out which is using up the bandwidth, and it shows mainly the 3 images linked from my site So, i only have 3 images (which people are displaying on their sites), and it is slowing down my server What if one day i wanted to add 5 images Then, it is going to shut the server down completely Quote Link to comment Share on other sites More sharing options...
mrdamien Posted April 27, 2008 Share Posted April 27, 2008 You're letting them hotlink your images? Yeah that could be the problem. Did you consider offloading the images to other servers like tinypic/photobucket/flickr ? Quote Link to comment Share on other sites More sharing options...
retro Posted April 27, 2008 Share Posted April 27, 2008 I'd certainly disable image hotlinking, that might not be helping you. Shared hosting always has the potential to be inherently slow. You have no idea how many sites are hosted on the same server as yours, or how many people are accessing any of the sites, or how much bandwidth they require. I would certainly quiz your host on the bandwidth usage on that particular server as a whole, not just your account. If you don't get an acceptable result, switch hosts. Quote Link to comment Share on other sites More sharing options...
npsari Posted April 27, 2008 Author Share Posted April 27, 2008 But i am renting an unmanaged Dedicated server I am not hosting with other people Do you think they are actually lying to me!!! Quote Link to comment Share on other sites More sharing options...
Fadion Posted April 27, 2008 Share Posted April 27, 2008 Unmanaged Dedicated Server and ure having speed problems? I got 10 mysql-enabled sites in my shared host, adding hundreds (probably exagerating here) of other's accounts and ive never faced a problem. At a good hosting company, for a dedicated server of your parameters, u could pay as much as $100 monthly. So if ure paying $10-$20 or whatever for it, switch company immediately. There are companies out there who provide really cheap hosting (being dedicated too) with a 10 Mbps link for several accounts. Thats for sure that u'll have problems. Quote Link to comment Share on other sites More sharing options...
dptr1988 Posted April 27, 2008 Share Posted April 27, 2008 Yes, you images probably are taking up more bandwidth then the rest of the files, but what is the total bandwidth compared to your maximum bandwidth capabilites? Have you confirmend that it's a bandwidth issue or a CPU issue? If it is hotlinking, those must be VERY popular images to be able to have three images slowing down your server. Doesn't your hosting company provide some type of 'cpanel' type interface that allows you to see server stats like processer load, percent bandwith usage? Quote Link to comment Share on other sites More sharing options...
retro Posted April 27, 2008 Share Posted April 27, 2008 Do you think they are actually lying to me!!! Possibly, yeah! Well OK, not lying. Is it a virtual server, though? If the price is cheap, chances are it is. That's where software runs on one box to split it into two (or sometimes more) servers. The other factor, as already mentioned, is how fast their pipe is. You might want to check. How big are these pictures, and how many hits do they get per day? First thing to do is block hotlinking. If that doesn't improve things, tell your hosting company that you get poor performance at a particular time of day. Ask them why this is, and what they can do to rectify the situation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.