Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL
Author Message
scorpious
Worker
Worker



Joined: Dec 03, 2005
Posts: 153

PostPosted: Fri Jan 27, 2012 5:46 am Reply with quote

Hi All

Within the rnlogs we have the following errors:

January 4, 2012, 9:12 am 2006 : MySQL server has gone away ( alot of these. )

SQL was: CREATE TABLE nuke_wiw_m (who VARCHAR(20), mn VARCHAR(20)) TYPE=memory
remote addr: 65.52.109.152

are these standard errors ?

The reason why I ask is, our CPU usage as been very high, its normally between 1.2 to 2.3 usage, however, since October last year its usage on afew occassion as been as high as 12.3, so we started to check the rnlogs and noticed the above errors.

Cheers
Scorp
 
View user's profile Send private message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Fri Jan 27, 2012 9:16 am Reply with quote

Here is a link I've found that might help to narrow your search down a little bit.
[ Only registered users can see links on this board! Get registered or login! ]

You might possibly have a script that is using more resources than are allocated to mysql.

also..
[ Only registered users can see links on this board! Get registered or login! ]

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Jan 27, 2012 9:37 am Reply with quote

We need to clean up the rnlogging process to avoid outputting multiple lines when the MYSQL server goes away. We need something in the ACP that checks the size of the dblog and truncates it (with a warning to the admin) when it gets above a predetermined size. Probably need a administration application to appear on the ACP for logging. I was even thinking that we could have different icons for the log, with a fat little one bursting at the seams when the log gets big. Just not enough hours in the day.
 
View user's profile Send private message Visit poster's website
killing-hours







PostPosted: Fri Jan 27, 2012 9:43 am Reply with quote

Couldn't that be done with a simple file size check and an if/then statement with a little css to make it all look good?

Something like....

Code:
function _format_bytes($a_bytes)

{
    if ($a_bytes < 1024) {
        return $a_bytes .' B';
    } elseif ($a_bytes < 1048576) {
        return round($a_bytes / 1024, 2) .' KiB';
    } elseif ($a_bytes < 1073741824) {
        return round($a_bytes / 1048576, 2) . ' MiB';
    } elseif ($a_bytes < 1099511627776) {
        return round($a_bytes / 1073741824, 2) . ' GiB';
    } elseif ($a_bytes < 1125899906842624) {
        return round($a_bytes / 1099511627776, 2) .' TiB';
    } elseif ($a_bytes < 1152921504606846976) {
        return round($a_bytes / 1125899906842624, 2) .' PiB';
    } elseif ($a_bytes < 1180591620717411303424) {
        return round($a_bytes / 1152921504606846976, 2) .' EiB';
    } elseif ($a_bytes < 1208925819614629174706176) {
        return round($a_bytes / 1180591620717411303424, 2) .' ZiB';
    } else {
        return round($a_bytes / 1208925819614629174706176, 2) .' YiB';
    }
}

$error_log_size = _format_bytes(filesize(error_log))


The format function pulled from [ Only registered users can see links on this board! Get registered or login! ]

Or it could just be left in bytes without converting.
 
fkelly







PostPosted: Fri Jan 27, 2012 9:46 am Reply with quote

Determining the file size could be done that way. Wrapping it all up in an admin application would take a bit more work. Feel free to take it on ...

For now we just have to emphasize (as we do in the comments in rnconfig) to administrators that if they are going to use the dblogging tool they have to monitor it regularly.
 
killing-hours







PostPosted: Fri Jan 27, 2012 9:50 am Reply with quote

What do you propose is a good threshold for the size? I've never really given it any thought... but doesn't seem like it's something major and gives me a good opportunity to play with mantis.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Fri Jan 27, 2012 9:52 am Reply with quote

scorpious, ask your host about the "MySQL server has gone away" errors. What version of mysql is running on your server?

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
scorpious







PostPosted: Fri Jan 27, 2012 9:53 am Reply with quote

Hi Killing-hours

Cheers for the reply

Before posting here, I tent to search Google and last night I spent over 3 hours searching, however, I did not find any decent explainations.

First search was at Mysql

Second search, I am sure this is what I typed in Google

http://lmgtfy.com/?q=%22MySQL+server+has+gone+away%22

so, as I asked before, are these standard errors ?

A simple yes or no would suffice, as we are trying to track down why the CPU Usage could go that high as I said in my first post.

Cheers
Scorp
 
killing-hours







PostPosted: Fri Jan 27, 2012 10:03 am Reply with quote

scorpious, I wasn't try to be rude or imply you didn't search, but from the 5 minutes worth of searching I did on the matter I found out pretty quick that it "appears" to be a resource problem (I.e. not enough resources are allocated to mysql ORRRRRRRRR a script is throwing to much information to the db).

that's not saying it's your exact problem... but it seems this warning is more difficult to track down rather than saying "yep... it's precisely this or that".

Did you change anythign in October of last year or did the host change anything?
 
fkelly







PostPosted: Fri Jan 27, 2012 10:05 am Reply with quote

Re. appropriate size ... I don't know exactly. Perhaps what we ought to try is just manually keep boosting the size of a text file till we reach the limits on what CPANEL will edit. I reached it with my .htaccess file the other day when I was adding IP's to ban from the countries table. I think I had 80k lines or something a bit more than that and the file size was getting up towards 2 megs. Probably 100k? Since we set parameters in rnconfig there could be a default file size (say 100k) with the option for an admin to boost it.

For the logging process itself, if possible when we write the log messages out we should look at the previous one. If it is a mysql server has gone away message and on the same day and near the same time, we probably don't need two of them. The site won't be working anyway but every time someone clicks on something and tries to load a page they are going to generate 100 plus such errors. It adds up and is unnecessary.

Yes, it would be a good opportunity Killing.
 
Palbin







PostPosted: Fri Jan 27, 2012 10:15 am Reply with quote

Guys please do not highjack a topic.

scorpious, are you hosting your own site or have you purchased a hosting plan? If you have purchased a plan through a hosting company you need to ask them about the DB dropping connections.
 
scorpious







PostPosted: Fri Jan 27, 2012 10:47 am Reply with quote

Hi Palbin

Mysql version is 5.0

Its a purchased hosting plan
We have put a support ticket in, see what they have to say.

This site is not mine, its belongs to a good friend of mine who runs it.

www.carp-in-on.com

We both are on the same hosting provider and as I have not seen errors like that in my logs I was wondering what may have caused them.

His site has been disabled twice for High CPU usage, we have asked the provider what could be causing this and all they replied with was, it seams to becoming from Modules, they was unable to say which file or script. Thats when I started to view the Rnlogs.

Cheers Scorp
 
killing-hours







PostPosted: Fri Jan 27, 2012 10:53 am Reply with quote

nuke_wiw_m = "who is where" table.

Start by looking at the who is where module/block and the table in the database. [ Only registered users can see links on this board! Get registered or login! ]
 
Palbin







PostPosted: Fri Jan 27, 2012 11:36 am Reply with quote

scorpious, what version of RN are you both running?

We could try replacing "TYPE=memory" with "ENGINE=memory".
 
scorpious







PostPosted: Fri Jan 27, 2012 1:12 pm Reply with quote

Hi Palbin

RN Version rn2.40.01

Scorp
 
Palbin







PostPosted: Fri Jan 27, 2012 5:09 pm Reply with quote

At this point I think we need to wait for your host to response and see what they say.
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Jan 28, 2012 3:57 am Reply with quote

I believe this table uses mySQL's heap memory and isn't a physical table per se so it's possible your host has some restriction on the amount of memory MySQL can use and this causes the 'gone away' error when the account goes over its allotted limit.
Personally I don't use and remove it because I can see who's online, I don't need to know exactly where.
 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©