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

[CS:GO] ckSurf (1.18f, 24.11.2015)


Post New Thread Reply   
 
Thread Tools Display Modes
strat
New Member
Join Date: Apr 2017
Old 04-16-2017 , 02:10   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2541

I installed everything correctly and my server seems to be running great, except when I create Zones and save them they will still be there if I were to change the map and change it back, but when the server restarts the zones are not there and it says Zonegroup not found. In order to load the zones I need to go into the admin menu and manually load the zones. Any way to automatically load the zones?
strat is offline
Cooky
Veteran Member
Join Date: Jun 2010
Location: 127.0.0.1
Old 04-16-2017 , 05:38   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2542

Quote:
Originally Posted by strat View Post
I installed everything correctly and my server seems to be running great, except when I create Zones and save them they will still be there if I were to change the map and change it back, but when the server restarts the zones are not there and it says Zonegroup not found. In order to load the zones I need to go into the admin menu and manually load the zones. Any way to automatically load the zones?
LOL.. nice reading... litteraly 5 posts above yours: https://forums.alliedmods.net/showpo...postcount=2544
Cooky is offline
MrJerry
Junior Member
Join Date: Feb 2016
Old 04-18-2017 , 18:14   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2543

Hello,

I use CkSurf for a minigames server, but when all player in one team are dead the round don't restart..
i try to put some line in my server.cfg but still the same please someone can explain me how to resolve that ?
ty
MrJerry is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-20-2017 , 18:34   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2544

So I've come to find out that there is a very inefficient query that causes serious SQL usage, and in my experience up to almost 30 second query times with a populated database.

Code:
char sql_selectRecordCheckpoints[] = "SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' UNION SELECT a.zonegroup, b.cp1, b.cp2, b.cp3, b.cp4, b.cp5, b.cp6, b.cp7, b.cp8, b.cp9, b.cp10, b.cp11, b.cp12, b.cp13, b.cp14, b.cp15, b.cp16, b.cp17, b.cp18, b.cp19, b.cp20, b.cp21, b.cp22, b.cp23, b.cp24, b.cp25, b.cp26, b.cp27, b.cp28, b.cp29, b.cp30, b.cp31, b.cp32, b.cp33, b.cp34, b.cp35 FROM ck_bonus a LEFT JOIN ck_checkpoints b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup";
(line 72 in sql.sp)

Cleaned up, readable query:
PHP Code:
SELECT zonegroupcp1cp2cp3cp4cp5cp6cp7cp8cp9cp10cp11cp12cp13cp14cp15cp16cp17cp18cp19cp20cp21cp22cp23cp24cp25cp26cp27cp28cp29cp30cp31cp32cp33cp34cp35
FROM ck_checkpoints
WHERE steamid 
'%s' AND mapname='%s' UNION SELECT a.zonegroupb.cp1b.cp2b.cp3b.cp4b.cp5b.cp6b.cp7b.cp8b.cp9b.cp10b.cp11b.cp12b.cp13b.cp14b.cp15b.cp16b.cp17b.cp18b.cp19b.cp20b.cp21b.cp22b.cp23b.cp24b.cp25b.cp26b.cp27b.cp28b.cp29b.cp30b.cp31b.cp32b.cp33b.cp34b.cp35
FROM ck_bonus a LEFT JOIN
     ck_checkpoints b
     ON a
.steamid b.steamid AND a.zonegroup b.zonegroup
WHERE a
.mapname '%s'
GROUP BY a.zonegroup"; 
I ran a profile on a sample query, this is what I came up with:

Spoiler


As you can see, it takes an insane amount of time, and the join isn't using indexes when a map has a bonus. Maps with large numbers of completions & players loading can cause servers to see severe delays in initial player loading times.

Any mysql wizards out there that might be able to help with this?

Edit: SOLVED, see this post: https://forums.alliedmods.net/showpo...postcount=2556
__________________

Last edited by sneaK; 04-21-2017 at 01:16.
sneaK is offline
fluffys
Member
Join Date: Jun 2015
Old 04-20-2017 , 22:20   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2545

Quote:
Originally Posted by sneaK View Post
So I've come to find out that there is a very inefficient query that causes serious SQL usage, and in my experience up to almost 30 second query times with a populated database.

Code:
char sql_selectRecordCheckpoints[] = "SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' UNION SELECT a.zonegroup, b.cp1, b.cp2, b.cp3, b.cp4, b.cp5, b.cp6, b.cp7, b.cp8, b.cp9, b.cp10, b.cp11, b.cp12, b.cp13, b.cp14, b.cp15, b.cp16, b.cp17, b.cp18, b.cp19, b.cp20, b.cp21, b.cp22, b.cp23, b.cp24, b.cp25, b.cp26, b.cp27, b.cp28, b.cp29, b.cp30, b.cp31, b.cp32, b.cp33, b.cp34, b.cp35 FROM ck_bonus a LEFT JOIN ck_checkpoints b ON a.steamid = b.steamid AND a.zonegroup = b.zonegroup WHERE a.mapname = '%s' GROUP BY a.zonegroup";
The query only takes around 0.2 - 0.3 seconds for me, however you could possibly just modify the query and remove the bonus checkpoints, I don't think there's any surf map that has a staged bonus, so the checkpoints for bonuses is rather useless

Code:
SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' AND zonegroup = 0;

Last edited by fluffys; 04-20-2017 at 22:21. Reason: strings !!
fluffys is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-20-2017 , 22:48   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2546

Quote:
Originally Posted by fluffys View Post
The query only takes around 0.2 - 0.3 seconds for me, however you could possibly just modify the query and remove the bonus checkpoints, I don't think there's any surf map that has a staged bonus, so the checkpoints for bonuses is rather useless

Code:
SELECT zonegroup, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25, cp26, cp27, cp28, cp29, cp30, cp31, cp32, cp33, cp34, cp35 FROM ck_checkpoints WHERE steamid = '%s' AND mapname='%s' AND zonegroup = 0;
That's what I was thinking, I don't have any staged bonuses but I don't want to remove the functionality of bonus checkpoints. I'm using this query as a temporary workaround, but it's not a proper fix.

Could you list your ck_bonus and ck_checkpoints indexes for me? If it's not asking too much, could you also do an EXPLAIN like I have above so I can see the result of yours? I'd be interested if it was different for some reason.

Also, the time it takes varies with the amount of completions total, and on the map since as you can see in the EXPLAIN, it is essentially doing a full db scan.
__________________

Last edited by sneaK; 04-20-2017 at 23:13.
sneaK is offline
fluffys
Member
Join Date: Jun 2015
Old 04-20-2017 , 23:20   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2547

Quote:
Originally Posted by sneaK View Post
That's what I was thinking, I don't have any staged bonuses but I don't want to remove the functionality of bonus checkpoints.

Could you list your ck_bonus and ck_checkpoints indexes for me? If it's not asking too much, could you also do an EXPLAIN like I have above so I can see the result of yours? I'd be interested if it was different for some reason.

Also, the time it takes varies with the amount of completions total, and on the map since as you can see in the EXPLAIN, it is essentially doing a full db scan.
My ck_bonus will be different because I've added styles
Spoiler

Last edited by fluffys; 04-20-2017 at 23:51.
fluffys is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-21-2017 , 00:12   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2548

Holy crap. SOLVED, after like a week.

Apparently you can't use indexes with a join statement between 2 tables that have different collations. I think the initial installation of cksurf created ck_bonus using collation 'utf8_general_ci', and ck_checkpoints using 'latin1_swedish_ci'. Changing ck_bonus to use latin1_swedish_ci did the trick, sped up queries by over 100x.

Thanks for the help fluffys!
__________________

Last edited by sneaK; 04-21-2017 at 00:17.
sneaK is offline
zwetch
Senior Member
Join Date: Aug 2015
Location: South Africa
Old 04-21-2017 , 04:21   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2549

How do I add Bonus tiers from in-game with a command? Or can Bonus tiers only be added directly to the Database.
zwetch is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-21-2017 , 11:56   Re: [CS:GO] ckSurf (1.18f, 24.11.2015)
Reply With Quote #2550

Quote:
Originally Posted by zwetch View Post
How do I add Bonus tiers from in-game with a command? Or can Bonus tiers only be added directly to the Database.
Code:
sm_addmaptier - Usage: sm_addmaptier <ZoneGroup> <Tier>
Zonegroup 0 = Main map
Zonegroup 1 = Bonus 1
Zonegroup 2 = Bonus 2

etc
__________________
sneaK is offline
Reply



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 18:56.


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