TinyPortal

General => Chit chat => Topic started by: Lord Anubis on January 18, 2008, 01:42:44 AM

Title: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: Lord Anubis on January 18, 2008, 01:42:44 AM
My site has grown tremendously and now my host sends me this crap about my DATABASE:

QuoteOur support staff has responded to your request, details of which are described below:

Discussion Notes
Support Staff Response
Dear Sir/Madam,

In regards to your hosting, nextsite.org

It appears that your Blanked database user has been over-utilizing system resources, and adversely affecting other users. Your mysql user has been disabled. Please reply with a detailed plan that you will undertake to reduce the load caused by your mysql user, and we can request a reinstatement of your mysql user. The following is an example of some of the queries causing this issue:

SELECT IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.signature, mem.personalText, mem.location, mem.gender, mem.avatar, mem.ID_MEMBER, mem.memberName,
mem.realName, mem.emailAddress, mem., mem.dateRegistered, mem.websiteTitle, mem.websiteUrl,
mem.birthdate, mem.memberIP, mem.memberIP2, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin,
mem.warning ,
mem.karmaGood, mem.ID_POST_GROUP, mem.karmaBad, mem.lngfile, mem.ID_GROUP, mem.timeOffset, mem.showOnline,
mem.buddy_list, mg.onlineColor AS member_group_color, IFNULL(mg.groupName, '') AS member_group,
pg.onlineColor AS post_group_color, IFNULL(pg.groupName, '') AS post_group, mem.is_activated,
IF(mem.ID_GROUP = 0 OR mg.stars = '', pg.stars, mg.stars) AS stars,
mem.usertitle
FROM smf_members AS mem
LEFT JOIN smf_log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN smf_attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN smf_membergroups AS pg ON (pg.ID_GROUP = mem.ID_POST_GROUP)
LEFT JOIN smf_membergroups AS mg ON ( mg.ID_GROUP = mem.ID_GROUP)
WHERE mem.ID_MEMBER = '3193'
BLANKED FOR PRIVACY Query 8 Locked SELECT
IFNULL(lo.logTime , 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.signature, mem.personalText, mem.location, mem.gender, mem.avatar, mem.ID_MEMBER, mem.memberName,
mem.realName, mem.emailAddress , mem.hideEmail, mem.dateRegistered, mem.websiteTitle, mem.websiteUrl,
mem.birthdate, mem.memberIP, mem.memberIP2, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin,
mem.warning,
mem.karmaGood, mem.ID_POST_GROUP , mem.karmaBad, mem.lngfile, mem.ID_GROUP, mem.timeOffset, mem.showOnline,
mem.buddy_list, mg.onlineColor AS member_group_color, IFNULL(mg.groupName, '') AS member_group,
pg.onlineColor AS post_group_color, IFNULL( pg.groupName, '') AS post_group, mem.is_activated,
IF(mem.ID_GROUP = 0 OR mg.stars = '', pg.stars, mg.stars) AS stars,
mem.usertitle
FROM smf_members AS mem
LEFT JOIN smf_log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN smf_attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN smf_membergroups AS pg ON (pg.ID_GROUP = mem.ID_POST_GROUP)
LEFT JOIN smf_membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP )
WHERE mem.ID_MEMBER = '3193'

Please contact us if you have any further issues.

David W.
Hosting Support
Hosting Operations

Okay, so now my bitching begins....

They quit my DB and didn't send me an email (12 hrs offline), I called them and complained and they decided to finally send me the above Email...

MY THOUGHTS:

I am sorry I have over 300 people online at a given time...

The DB queries are obviously alot, but I am NOT over using my bandwidth for the site

So their solution (when angrily contacted):  Give us 80 bucks a month (for dedicated) and we will reinstate your DB for your site...

So anyone got a good hosting place for me, hell these asses wont even let me grab my DB... IT IS LOCKED TILL REINSTATEMENT!!! GO godaddy!

MY EMAIL TO THEM 30 MINS AGO:


Here is my plan to optimize my use of the database user BLANKED

Phase 1: I will enable error logging on my site (I currently use  SMF + TP), which will show me which scripts are not running correctly or efficiently

Phase 2: I will see if any of my created  "BLOCKS" from TinyPortal are querying the DB the most and take them offline, or optimize the code to reduce DB queries

Phase 3: I will PM (Personal Message) all my users and delete inactive accounts (wont do anything for the query size but for the overall DB size) Which will enable me to optimize my DB more efficiently since it will reduce the size

Phase 4: If needed I will discontinue service with GoDaddy, and all I need is access to my current DB to get my info and move on

SUGGESTIONS?

Hosting Idears?

What I need:

120 GB of space
and a DB of at least 1.5 GB

Any options?
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: IchBin on January 18, 2008, 02:56:41 AM
I hate to say it, but with a site that size you do need a bigger hosting plan. Perhaps a dedicated.
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: Lord Anubis on January 18, 2008, 03:28:48 AM
Damn they said that too...lol

But I haven't maxed out the plan yet; almost but not quite....About 6000 more users daily would kill my bandwidth or 1500 subscribed users....(I am a stats person ( hell an EE)) lol.. but true

So that seems to be the option, :'(

I was being optimistic, but with my DB as large as it is I cant even optimize it anymore
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: Hairy on January 18, 2008, 04:59:12 AM
Wouldn't you need over 1,000,000 posts to use 1.5GB database?

Maybe even 10,000,000+ when recalculating  :-\
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: tick on January 18, 2008, 06:00:04 AM
I agree with what Ichbin says.  This site is just two big to run in a shared environment.  Even though host do say you can have these large amounts of space a bandwidth you limit your other usage so much you could never use that much.   This is a classic example of how a overseller gets ya.   I would look into getting a vps or maybe even a dedicated server for this setup.  We are only offering shared hosting atm but may could get you into a box if you decide to go that route.  Shoot me a message if you would like to look into some options.   Tick
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: Dazed on January 18, 2008, 06:07:43 AM
http://www.hostgator.com/shared.shtml
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: tick on January 18, 2008, 06:13:31 AM
I feel pretty confident in saying that he will also encounter this problem with hostgator also.
Title: Re: RANT & RAVE FROM ME: Optimizing DB queries?
Post by: Lord Anubis on January 18, 2008, 06:47:26 AM
NO Gaytor lol hosting for me I have looked into their shady practices.....

TICK I will PM you but I feel it might be fuitile