Jump to content
 Share

Roy

CS:GO Surf Timer Performance Issues

Recommended Posts

Hey everyone,

 

I just wanted to make a quick thread on this issue.

 

Since we've relaunched Surf Timer this year, I've noticed poorer performance compared to when we ran a full 64/64 Surf Timer server back in 2014 - 2015. This had me wondering if CS:GO servers just generally have worse performance compared to back then. The Linux networking thread should be available and used as stated here. The current machine also runs with the Intel i7-7700K compared to the Intel Xeon 1271v3 which is the CPU our old server's machine ran with. Yet, our new server has had worse performance.

 

After playing on the server for a while, I noticed performance on maps with no weapons was A LOT better. I confirmed that maps with weapons such as surf_kitsune and surf_horizon_njv had much worse performance than maps without weapons such as surf_beginner. Therefore, it was an issue with weapons. I wasn't sure if this was an issue with CS:GO in general or if there was a possible plugin on the server causing this. Considering other servers don't seem to have issues, I assumed it was a plugin.

 

Anyways, I copied over the CS:GO 64-slot Surf Timer server to a test server via tar in Linux, setup the CFG file like the following to test with bots, and had at it:

 

sv_cheats 1
bot_dont_shoot 1
sv_stressbots 1
bot_zombie 1

 

This made it so the bots didn't shoot and stood mostly still. If the bots were to shoot, the server would have poor performance no matter what the outcome of disabling plugins was.

 

I confirmed the performance issue was due to the weapons by stripping all the player's/bot's weapons and seeing the server FPS go from 20 - 30 to 64. With that said, the more weapons the client have in their inventory, the worse the performance is. When I added knives only to the bots in the server, the performance took a dip, but it wasn't as bad. Once I added a glock to the bots, it took a bigger hit. Adding a primary weapon lagged the server badly.

 

After troubleshooting, I found out the Hide Players plugin that Influx Timer provides is causing this issue. The server instantly went from 20 - 30 FPS to 64 after disabling the plugin. I also disabled this plugin temporarily on both Surf Timer servers and the performance had a major increase. 

 

I later found out this was due to the SDKHooks SetTransmit function which is used here. I also made a plugin which had the same issue no matter what was inside the hook. Here is the source code:

 

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin myinfo =
{
	name = "Test Transmit",
	author = "Christian Deacon",
	description = "...",
	version = "1.0.0",
	url = "GFLClan.com"
};

public void OnPluginStart()
{
	// Late Load Clients.
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))
		{
			continue;
		}
		
		SDKHook(i, SDKHook_SetTransmit, xd);
	}
	
	RegAdminCmd("sm_xd", Command_XD, ADMFLAG_SLAY);
	RegAdminCmd("sm_xd2", Command_XD2, ADMFLAG_SLAY);
}

public Action Command_XD (int iClient, int iArgs)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))
		{
			continue;
		}
		
		SDKUnhook(iClient, SDKHook_SetTransmit, xd);
	}
}

public Action Command_XD2 (int iClient, int iArgs)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i))
		{
			continue;
		}
		
		SDKHook(iClient, SDKHook_SetTransmit, xd);
	}
}

public void OnClientPutInServer(int iClient)
{
	SDKHook(iClient, SDKHook_SetTransmit, xd);
}

public Action xd (int iEnt, int iClient)
{
	return Plugin_Continue;	// Players are all still visible for testing the hook itself.
}

 

I've tried altering some server commands to see if it helped. However, I had no luck.

 

I'm going to do some debugging and try to find what the hook does itself in CS:GO. I'll probably try searching the CS:GO SDK (example). This should help a bit.

 

In the meantime, @juky is going to be looking into adding a plugin that strips all the weapons when a player enters the round for the first time. The player can still type !knife in chat to receive a knife if they want it. This is the best solution I can think of until we resolve the issue and since the hide players functionality is important, we'd want to keep it enabled.

 

Also, thanks to @juky for help testing!

 

Thank you.

Share this post


Link to post
Share on other sites




×
×
  • Create New...