AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_disconnected() <-> plugin_end() (https://forums.alliedmods.net/showthread.php?t=316227)

JocAnis 05-13-2019 12:36

client_disconnected() <-> plugin_end()
 
hi guys. i have made a plugin which is using mysql module. problem accuress when map change is happening..meaning server is 'freezed' for about 10sec (which should be 2-3max sec normal)...when the plugin is off -> all good...so i started to analize where is the problem for that, and my brain is telling me:

plugin is sending too much queries at map change, why that:

on client_disconnected( id ) im updating every player one colomn (column for last connection), server is almost everyday 30/32

so is client_disconnected( id ) called right before plugin_end() ?

*pls dont write : go test it, cuz im not in situation to test it
on plugin_end() im doing sql_freehandle

HamletEagle 05-13-2019 12:47

Re: client_disconnected() <-> plugin_end()
 
Go test it. Put a print in plugin_end and in client_disconnect with the current game time, change the map and see if you get similar timestamps.
It literally takes 5 seconds to test and it works even in local servers.

JocAnis 05-13-2019 12:57

Re: client_disconnected() <-> plugin_end()
 
Ok i will test on lan with one/two players, im not sure if thats proper test but thank you for trying to help

iceeedr 05-13-2019 13:03

Re: client_disconnected() <-> plugin_end()
 
You can try to use on amx 1.9, and see if lag occurs.

PHP Code:

public server_changelevel(map[])
{
    
// code here



JocAnis 05-13-2019 13:18

Re: client_disconnected() <-> plugin_end()
 
@iceeedr that seems optimistic

ill see later when i have time for it..im just hoping amx_nextmap isnt working with changelevel because server_changelevel cant catch it?

iceeedr 05-13-2019 13:21

Re: client_disconnected() <-> plugin_end()
 
amx_nextmap in amx 1.9 uses the server_changelevel command, it's just an attempt rs

JocAnis 05-13-2019 16:32

Re: client_disconnected() <-> plugin_end()
 
thank you @iceeedr,

Code:

[pub_mysql_ranking.amxx] changemap: 7.226326
L 05/13/2019 - 22:16:15: [pub_mysql_ranking.amxx] disconnect() 7.241017
L 05/13/2019 - 22:16:15: [pub_mysql_ranking.amxx] plugin_end() 7.241017

adding bool to server_changelevel is enough in my opinion

ps: again 10sec waiting :/ i think its in conflict with another mysql plugin or smth

klippy 05-14-2019 08:02

Re: client_disconnected() <-> plugin_end()
 
What's the latency from your game server to your MySQL server? Queries will execute in order (even if they are threaded), and if say the latency is 100ms and you query 30 times on mapchange, that will be 3 seconds of querying in total. You could update all 30 rows in 1 query if you build the query dynamically, and while that is not ideal at all, it's probably better. I really don't know whats the right way to get rid off this limitation.

Anyway I'm just guessing what could be the problem here, I don't know anything about your setup.

JocAnis 05-15-2019 16:07

Re: client_disconnected() <-> plugin_end()
 
@klippy i have no idea how to see latency from server <-> mysql

but after pausing GameMe plugin and adding bool into server_changelevel for this plugin 'problem' is solved, thanks guys

JocAnis 05-20-2019 17:25

Re: client_disconnected() <-> plugin_end()
 
Problem isnt solved...i removed updating rows on mapchange, but present error is:
Code:

Thread worker was unable to start
found so many threads about this problem but withou solution, except here, the last post, but dont know what he exactly changed : https://forums.alliedmods.net/showth...=129246&page=2

type of the server is deathmatch free for all (meaning every second (or less) is one row affected by update/insert...is this error connected to that (to many sending queries) or its happening on map change (sending query when sqL_freehandle is executed) ? im starting to think mysql + amxx cant work very well with this mode on the server...


All times are GMT -4. The time now is 01:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.