Raised This Month: $12 Target: $400
 3% 

client_disconnected() <-> plugin_end()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-13-2019 , 12:36   client_disconnected() <-> plugin_end()
Reply With Quote #1

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
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-13-2019 , 12:47   Re: client_disconnected() <-> plugin_end()
Reply With Quote #2

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.
__________________
HamletEagle is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-13-2019 , 12:57   Re: client_disconnected() <-> plugin_end()
Reply With Quote #3

Ok i will test on lan with one/two players, im not sure if thats proper test but thank you for trying to help
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-13-2019 , 13:03   Re: client_disconnected() <-> plugin_end()
Reply With Quote #4

You can try to use on amx 1.9, and see if lag occurs.

PHP Code:
public server_changelevel(map[])
{
    
// code here

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 05-13-2019 at 13:03.
iceeedr is offline
Send a message via Skype™ to iceeedr
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-13-2019 , 13:18   Re: client_disconnected() <-> plugin_end()
Reply With Quote #5

@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?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-13-2019 , 13:21   Re: client_disconnected() <-> plugin_end()
Reply With Quote #6

amx_nextmap in amx 1.9 uses the server_changelevel command, it's just an attempt rs
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-13-2019 , 16:32   Re: client_disconnected() <-> plugin_end()
Reply With Quote #7

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
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 05-13-2019 at 16:49.
JocAnis is offline
Old 05-13-2019, 17:04
gabuch2
This message has been deleted by gabuch2. Reason: nvm
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-14-2019 , 08:02   Re: client_disconnected() <-> plugin_end()
Reply With Quote #8

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.
__________________
klippy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-15-2019 , 16:07   Re: client_disconnected() <-> plugin_end()
Reply With Quote #9

@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
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-20-2019 , 17:25   Re: client_disconnected() <-> plugin_end()
Reply With Quote #10

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...
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 05-20-2019 at 17:26.
JocAnis is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:55.


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