[Question] Mysql
#1

Hey guys,

I just found an issue with my mysql server, and some how when your connecting to the server you seems to lost the connection after a while when it's saying "joining server."

and suddenly the server restarts, it's like you have to high ping and the server automaticly restarts.

Any idйas why?
Reply
#2

We can't read your mind. Drop your code here.
Reply
#3

Well there aint a code for this, or maby.

I think it's something wrong with the connection to my mysql server cause of the restart.

pawn Код:
mysql_connect(HOST_ADDR, HOST_USER, HOST_PASS, HOST_DATA);
Thats the only think I can come up to that might be an issue...
Reply
#4

which mysql plugin did you use ?
Reply
#5

I had a problem simular to this aswell. My sever was to overloaded running with a high ammount of RAM and taking alot of CPU.. I think it was around 40% on a i7 Processor Computer which was really bad. So I sorted out a few files. Deleted some filterscripts that went in use and walla' it went down to 2%. But I advise cleaning your folder. Removing any unwanted items out of it and keeping it that way. I also advise not to use so much mapped objects with a streamer. Streamers take up aload of CPU and that's why I also had to create a new map with only cars and icons on it to work fully functionaly.
Reply
#6

Quote:
Originally Posted by NRG2
Посмотреть сообщение
I had a problem simular to this aswell. My sever was to overloaded running with a high ammount of RAM and taking alot of CPU.. I think it was around 40% on a i7 Processor Computer which was really bad. So I sorted out a few files. Deleted some filterscripts that went in use and walla' it went down to 2%. But I advise cleaning your folder. Removing any unwanted items out of it and keeping it that way. I also advise not to use so much mapped objects with a streamer. Streamers take up aload of CPU and that's why I also had to create a new map with only cars and icons on it to work fully functionaly.
Hmm Nice, It sounds great.
Thanks for the advice I'm going to check it right away.
Reply
#7

If you are using G-Stylezzz's mysql plugin, yes, you will lose connection after a while. What you can do is, make a timer checking if mysql_ping == -1 and if so, use mysql_reconnect. ( Not sure if it happens on other plugins since I've only used G-Stylezzz's )
Reply
#8

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
If you are using G-Stylezzz's mysql plugin, yes, you will lose connection after a while. What you can do is, make a timer checking if mysql_ping == -1 and if so, use mysql_reconnect. ( Not sure if it happens on other plugins since I've only used G-Stylezzz's )
At the moment the first tips I got didn't work, going to test this out.
Thanks alot, just a quick questions under which public section should I pust this mysql_reconnect and mysql_ping?

Regards Tony,
Reply
#9

Like L3th4l said, create a timer.
Im not sure about the MySQL functions, but with this youre able to continue:
pawn Код:
new MySQLTimer; // global variable for the timer
forward MySQLChecker(); // forwarding the timer

MySQLTimer = SetTimer("MySQLChecker", 3000 /*can be more, can be less etc*/, true); // add this to OnGameModeInit

public MySQLChecker()
{
    // MySQL functions to check the ping etc
    return 1;
}

KillTimer(MySQLTimer); // add this on OnGameModeExit
Reply
#10

You don't actually need a 3 second timer, it disconnects after a while running. So I say you use a ~15 min timer.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)