Lagg (MySQL?) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Lagg (MySQL?) (
/showthread.php?tid=288910)
Lagg (MySQL?) -
Siedler - 09.10.2011
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
Re: Lagg (MySQL?) -
Crystyan12 - 09.10.2011
You use OnPlayerUpdate for players with timer?
AW: Lagg (MySQL?) -
Siedler - 09.10.2011
No i don't use OnPlayerUpdate and not much timer.
It's lagg only with MySQL
Login: 4 Querys
Logout: 2 Querys
Re: Lagg (MySQL?) -
Vince - 09.10.2011
Thread all your queries and you won't have problems.
AW: Lagg (MySQL?) -
Siedler - 09.10.2011
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
Re: Lagg (MySQL?) -
Vince - 09.10.2011
https://sampwiki.blast.hk/wiki/MySQL#mysql_query
Read the note that's marked in red.
AW: Lagg (MySQL?) -
Siedler - 09.10.2011
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;
}
|
AW: Lagg (MySQL?) -
Siedler - 10.10.2011
Quote:
Important Note: It's highly recommended to thread all your queries (even INSERT & UPDATE).
|
What i can Thread here and how? :>
Re: AW: Lagg (MySQL?) -
Retardedwolf - 10.10.2011
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.
AW: Re: Lagg (MySQL?) -
Siedler - 12.10.2011
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? :>