Lagg (MySQL?)
#1

Hey

My Server is lagging when 3-4 players join/disconnect at same time..
I'm using MySQL Plugin from G-StyleZZZ

MySQL Settings

Quote:

key_buffer = 320M
max_allowed_packet = 320M
thread_stack = 512K
thread_cache_size = 16
query_cache_limit = 100M
query_cache_size = 160M
key_buffer = 64M

Screenshot from gmx



without MySQL Plugin it's work perfectly
Reply
#2

You use OnPlayerUpdate for players with timer?
Reply
#3

No i don't use OnPlayerUpdate and not much timer.
It's lagg only with MySQL

Login: 4 Querys
Logout: 2 Querys
Reply
#4

Thread all your queries and you won't have problems.
Reply
#5

what do you mean with that?

Login
- Check if account exist's
- Check if account is banned (if yes, load І ban data)
- Load account data if account isnt banned (1 Query)
- Save to Database, status Online if logged in succesfully.

Logout
- Save Account Data (1 Query)
- Set Status Offline
Reply
#6

https://sampwiki.blast.hk/wiki/MySQL#mysql_query
Read the note that's marked in red.
Reply
#7

I do not understand what I have to change.

Quote:

public OnPlayerConnect(playerid)
{
mysql_query("UPDATE 'accounts' SET Status='1' WHERE name='Myname'",THREAD_LOADPLAYER, playerid);
return 1;
}

public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
switch(resultid)
{
case THREAD_LOADPLAYER:
{
mysql_store_result();
if(IsPlayerConnected(extraid))
{
// ??
}
mysql_free_result();
}
}
return 1;
}

Reply
#8

Quote:

Important Note: It's highly recommended to thread all your queries (even INSERT & UPDATE).

What i can Thread here and how? :>
Reply
#9

Quote:
Originally Posted by Siedler
Посмотреть сообщение
What i can Thread here and how? :>
https://sampforum.blast.hk/showthread.php?tid=258231

Scroll down to Calgon's post, he will explain.
Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
Thread all your queries and you won't have problems.
Hey,

im thread now all querys but on server restart (gmx) ~40 players connect each second, server is crashing.
some ideas? :>
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)