• Having Problems With Garry's Mod Server - Lag?
    20 replies, posted
I am hosting a Garry's Mod TTT Server on Linux (SteamCMD). Throughout playing player(s) walking will be choppy and going up/down ladders is really choppy. You can also walk through props. My server is using 30% CPU usage and 50% RAM. Everyone has 40-120 ping. The servers upspeed is about 200 mb/s. I am guessing it is something I am doing wrong starting the server? I am only running pointshop addon plus some custom player models. Thanks in advanced, Fetz
try sitting the tickrate to 33
What CPU does the server have? SRCDS isn't multi-threaded which means that the server will only utilize two threads, one for networking and one for the server and its physics, so it doesn't matter if your server has a hex-core processor with low clockrate. A dual-core with higher clock-rate would benefit the server alot more. You can check if the server is using 100% of a thread at that point if you install the htop linux package: [CODE] apt-get install htop -- Or this one, depending on what distro of linux you use. yum install htop [/CODE] Now run the newly installed package by issuing a command: [B]htop[/B] You will see a few bars looking like this, depending on how many cores/threads you have and if Hyper-Threading is enabled: [IMG]http://puu.sh/6rlD6.png[/IMG] Those are your CPU's cores/threads. If one of them are utilizing nearly 100% when your server is under load, then you know your CPU can't handle the amount of players and/or physics your server is having. That's when you put this into the startup params of your shell script: [B]-tickrate 33[/B]. Setting the tickrate to lower is very useful, the default tickrate is 66, setting it to 33 won't make any difference on Garry's Mod, but it has heavy impacts on games that relies on precision such as the Counter-Strike and Team-Fortress series. [QUOTE=Valve] Valve explains Tickrate as: "During each tick, the server processes incoming user commands, runs a physical simulation step, checks the game rules, and updates all object states. After simulating a tick, the server decides if any client needs a world update and takes a snapshot of the current world state if necessary. A higher tickrate increases the simulation precision, but also requires more CPU power and available bandwidth on both server and client." [/QUOTE] Hope this helps a bit! :) [editline]20th January 2014[/editline] Also, a tip: The Intel Xeon E3-1290v2 (3.7Ghz, 4.1Ghz turbo boost), Intel Xeon E3-1240v2 (3.4Ghz, 3.8Ghz turbo boost) and Intel Xeon E3-1230v2 (3.3Ghz, 3.7Ghz turbo boost) are very good CPU's for handling a GMod server! :wink:
Because the issue involves an increase in ping. It may have something to do with the network connection.
I got htop and monitered the CPU... none of the cores went over 60%. Same for the RAM :/ I don't understand why it still lags.
[QUOTE=fetzington;43610061]I got htop and monitered the CPU... none of the cores went over 60%. Same for the RAM :/ I don't understand why it still lags.[/QUOTE] Turn on net_graph 4 in your own console and watch the blue line at the very bottom of the graph when connected to your server. If red spikes appears there, the server lags. If not, your computer is the one that lags.
Red Line(S) appear at combat a lot. Is this ping lag or FPS lag?
No, you're looking at the client graph. You want to look for red like in this picture: [IMG]http://i.imgur.com/5Wx8N.jpg[/IMG] (The highligted area, can you see the red spikes there? If you do on your own server, THEN you know that the server is lagging. Otherwise, it's all client-side and has nothing to do with the server).
Hey, I'm having the same problem, I am having the same red bars at the bottom of the net graph. I have installed and run htop but it's not showing any cpu overload. Eveyone's ping on the server is less than 100, well mostly. See images below: [IMG]http://i.imgur.com/Jct0FEW.png[/IMG] [IMG]http://i.imgur.com/tfXwlVX.png[/IMG] [IMG]http://i.imgur.com/7hmrYls.png[/IMG]
What's the specs on that CPU? Ghz wise. Lower tickrate to 33 with [B]-tickrate 33[/B] startup param.
I am unsure, I am hosting from a VPS, the only information I am given is that there are 3 cores dedicated to the VPS. I have submitted a request for the information though. I will apply the changes suggested and report back :) EDIT: The problem seems to persists when I set the parameter to 33.
Post your server.cfg, maybe you have something wrong there. If not try getting rid of addons.
The only addons I have are PointShop AssMod and mapvote. This is my server.cfg: [CODE]hostname "Samsta is awesome!" rcon_password "" sv_password "" sv_region 255 sv_lan 0 sv_logbans 1 sv_logecho 1 sv_logfile 1 sv_log_onefile 0 sv_noclipspeed 5 sv_noclipaccelerate 5 logging on //Sandbox Settings sbox_allownpcs 0 sbox_godmode 0 sbox_plpldamage 0 sbox_playergod 0 sbox_noclip 1 sbox_maxprops 250 sbox_maxragdolls 5 sbox_maxnpcs 5 sbox_maxballoons 25 sbox_maxeffects 25 sbox_maxdynamite 5 sbox_maxlamps 10 sbox_maxthrusters 250 sbox_maxwheels 50 sbox_maxhoverballs 50 sbox_maxvehicles 8 sbox_maxbuttons 50 sbox_maxsents 20 sbox_maxemitters 5 sbox_maxspawners 3 sbox_maxturrets 10 //Server Settings net_maxfilesize 30 sv_minrate 0 sv_maxrate 2500 decalfrequency 10 sv_maxupdaterate 66 sv_minupdaterate 10 //Execute ban files exec banned_ip.cfg exec banned_user.cfg sv_downloadurl "http://x.xxx.xxx.xxx/fastdl/" sv_allowdownload "1" sv_allowupload "1" net_maxfilesize 600 [/CODE]
Check this for Server Settings part: [url]https://support.steampowered.com/kb_article.php?ref=5386-HMJI-5162[/url]
The processor is 3GHz
[QUOTE=Briggybros;45943038]The processor is 3GHz[/QUOTE] So what? You are having internet lag ( "in: 6000" on the net_graph - that is not normal afaik ).
I have brought up the issue with the host, just to be sure, is 4GB of ram dedicated to the one application sufficient (plus a few background tasks)?
[QUOTE=Briggybros;45944572]I have brought up the issue with the host, just to be sure, is 4GB of ram dedicated to the one application sufficient (plus a few background tasks)?[/QUOTE] Yes, SRCDS hardly never uses more than 600MB. And that CPU should be able to handle a fair amount of players without issue, so it's problably as Robotboy says; it's client-side - your own network being the issue.
All of the players on the server are experiencing the same lag spikes at the same time. All of the players are not in the same location, to me it seems more than just my connection.
Make sure you put these convars for your server:[code] sv_minrate 0 sv_maxrate 2500 sv_maxupdaterate 66 sv_minupdaterate 10[/code] To have the values recommended by Valve ( from the link I posted )
Why are you using a maxrate of 2500? Are you running the server on a 2Mbps DSL connection or something? If you're running this with a GSP, or running it on your own dedicated server / VPS you're likely going to have at least 100Mbps. If that is the case use the following rates in your server.cfg:- sv_minrate 0 sv_maxrate 0 sv_minupdaterate 10 sv_maxupdaterate 66 You're currently getting choke because players are trying to receive data at the mid - higher end of the update rate but because your maxrate cvar is set so low at only 2500 not all the data is coming through as it should, or is being queued. Hope this helps.
Sorry, you need to Log In to post a reply to this thread.