View Full Version : what do you do in this situation?

08-29-2005, 10:14 PM
i've been with my host for the past 5 months on the same server with no problems at all until this weekend. friday night, the database for my largest site disappeared from the server. i emailed my host asking what happened, and they replied saying that there were too many queries on the database and it was causing the server to overload, so they disabled it and won't enable it until i fix my code. this site receives a large amount of traffic and is completely database driven, so i'm well aware of the fact that it queries the database often, which is why i've spent many hours optimizing the code and all the queries in the past. so when they told me i needed to fix my code i wasn't really sure what to fix, so i just made some minor changes that i thought could help, and sent the code to a friend who also said he couldn't find any problems with it. i email my host telling them i made some changes, a bit later they say the script looks fine now and re-enable the db. this seemed kind of like bs to me, seeing as how the script is 100+ pages and i only edited about 3 of those files, so how could they say that the script looks fine? but whatever, it seems like the problem is resolved.

sunday afternoon i wake up, the database is disabled again. i send an email asking them why, same reason as before and it won't be turned back on until i fix the code. i try to explain to them that this script is huge, and them telling me "it's bad, fix it" really is pointless since i have no idea where to start. after two days of emailing them back and forth trying to get some sort of useful information out of them, i get absolutely nothing, and finally they just randomly decide to turn the db back on and tell me "this better not happen again", but it almost certainly will since they were absolutely no help. basically they told me "we won't look at your script or help you in any way whatsoever, you're on your own, take care of the problem".

what i can't seem to understand is how after 5 months, the script is first starting to cause problems now, especially due to the fact that:
1) my traffic is about 2/3 the traffic i had last month
2) friday - sunday are my lowest traffic days

i really have no idea what to do at this point. they've disabled my site for the past 3 out of 4 days, which has really pissed me off. i'd switch to a new host, but i recognize that this site is very database heavy and most hosts probably wouldn't be able to handle it on a shared server. at the same time, i don't use enough bandwith to justify buying a dedicated server. the only thing i can think of doing is find some sort of script that will keep track of all my queries on the database, and how much time it takes to process each one. all i can think of is that i have a few bad queries that i haven't been able to pick out that are overloading the server. this post probably went on for way too long... sorry :p.. thanks in advance for any help.

08-30-2005, 06:10 AM
at the same time, i don't use enough bandwith to justify buying a dedicated server.

The reason you buy a dedicated server is for processing resources for things like MySQL queries. Rarely does anyone (atleast anyone who doesn't run a file downloading site) need to dedicated server because of bandwidth.

If your site makes enough to justify a dedicated server, I'd get one now. Otherwise I think you need to switch hosts, maybe get a VPS or something, anything where you don't share the resources with so many people.

Also remember that with a dedicated server you'll be able to host all your sites on it, and you'll be able to easily add new sites to it as you make them.

08-30-2005, 07:35 AM
Chris is right. You don't want downtime, especially when is that lengthy.

I have three different webhosts which I spread my sites out specificlly so that everything doesn't go down if one hosts has problems.

Maybe there are more people on the virtual server now and the hosts are blaming you instead.

09-01-2005, 06:13 AM
Have you done indexing, etc to the database itself to speed up the code on that side?
Usually, that makes a huge difference.
Otherwise, yeah, I'd look at a dedicated server, or at least a VPS. Something that can handle more load than a shared server at any rate.

09-01-2005, 12:27 PM
can you tell the name of the host so we dont want to land in the same situation

09-01-2005, 05:54 PM
Make sure your database is indexed correctly and your queries are using them correctly also. (EXPLAIN SELECT * FROM `table` WHERE `column` = 'value'; )

Cache contents if it does not need to be 100% dynamic.

You have to see this problem from your hosts point of view, your site is probably coming close to crashing the server which affects everyone - I was pretty much in the same situation a couple of years ago when I used a shared host.

Pay the $$$/mon and get a dedicated server. They are cheap ... EV1 has P4s for $150. If your site is getting enough traffic for this to happen i'd assume you make enough to cover that.

09-01-2005, 09:37 PM
yeah, i have my db indexed and have checked most queries with the EXPLAIN... that's how i know that it really can't get much more optimized than it already is.

anyway, about an hour after they enabled the db, i got an email saying that my db had overloaded the server again, and they sent me the queries that caused the overload... the queries didn't look like anything i used on any of my databases at all. a few hours later they sent me another email asking me to disregard the previous email... hmmm. anyway, since then the server has been running pretty smooth again.

as far as a dedicated server goes... i had one for about 3 months, and it was an absolutely terrible experience. the server i got was $200/month, and my friend said he would maintain it for $100/month... so it ended up being $300/month, + $200 setup fee that my admin charged me... i'm fairly certain i was ripped off. turned out the guy had absolutely no idea what he was doing, my site was down about 40% of the time because the server kept crashing, said it was my fault because i was generating 50 queries per second which was way more than any server could ever handle (which i knew was complete bs)... then upon finally moving to this host now, he confirmed his stupidity by accidentally corrupting my db instead of exporting it. so... not a good experience with the dedicated :p. that's why i moved to a shared server, so i wouldn't have to pay so much money, and not have to worry about downtime

09-01-2005, 11:45 PM
To be fair, thats your friends fault really, not the fault of dedicated servers.

Can you not get managed dedicated servers, which are similar to having shared, but you have the whole computer?

09-02-2005, 12:09 AM
I had a bad experience when first moving to a dedicated server. My problem - I picked an unknown company. Downtime, stole my money ... wasn't a good experience.

Go with Ev1, they are more than helpful and reputable. Yeah, your "friend" ripped you off...

Edit: or go with Nocster.com/BurstNET if you need managed. I would rather EV1 though, after being a customer of BurstNET for 12+ months.