Optimizing server to get to 100 players

Hey guys,
So I thought this was the best place to come! I have been having trouble growing my servers due to lag, crashing, and DDOS for a while now and I want to get a couple second opinions from you guys! I fixed the DDOS issue by switching my host over to a host that provides DDOS protection. Servers still seem to crash and lag when I get more players on the server.

  • Prop limit for my servers is around 30-40.
  • Tickrate is at 11 for all of our servers.

Below I will list some errors that cause the server to crash and my addons so that you guys can better help me.

Just recently I started getting the following error and right after I get this error the server crashes. I have contacted the maker of VCMod and he says it has nothing to do with VCMod. Some people on scriptfodder says it is a leaked version but I do not use leaks on any of my servers. Earlier today I updated all the VCMod addons so I will let you guys know if it helped solve the problem.

Not creating entity ‘info_particle_system’ - too many edicts! (8064 current, 8192 max)

[ERROR] vcmod/server/functions_shared.lua:2: Tried to use a NULL entity!

  1. SetKeyValue - [C]:-1
  2. Spawn_Particle - vcmod/server/functions_shared.lua:2
    3. HandleParticles - vcmod/server/particles.lua:2
    4. Think_Medium_Each - vcmod/server/main_vc1.lua:2
    5. fn - vcmod/server/main_shared_sf.lua:2
    6. unknown - addons/ulib/lua/ulib/shared/hook.lua:110

Workshop addons for 2 of my servers

Addons for one of my servers that seems to have lag issues when getting over 40-50 players

blogs
billyalarms
acrashscreen
adminpopups
advdupe2
atlaschat
awarn2
back_vault
blues-unboxing-2
cuffs
darkrp_defibrillator
drive_license
Drive_radar
eliteparty
enhanced-meth-laboratory
flathud
hitmanmenu
itemstore
moreulx
org
policeshield
prometheus
realistichandcuffs
seanrunk
speedometer
steamgroup_rewards
teamsradio
tire_pop
tomascustoms_printers
ulib
ulx
utime
vcmod els
vcmod main
bwhitelist
wire

A few people suggested finding a new admin mod instead of ulx because the top servers don’t use ulx because there are others that are better optimized. I have been told I need to watch my users.txt file for ulx because if that gets too big than it will slow down ulx and the server a lot.

A lot of people also say the problem is evocity in general which yes I know it lags a lot but my players like the map so I don’t know if I want to change the map or not.

Would it make my servers faster if I put the majority of stuff on MySQL instead of being saved to a data file?

Any suggestions would be greatly appreciated guys!

Almost all of the servers that can hold 100 players+ either have refined their addons to fit more optimised needs or are customly made from the ground up by a single or small group of developers. None of your addons are made to work with each other explicitly, and thus are generally going to run into conflicts and inefficiencies at higher player counts. Although you may be able to fix the crashes, lag is inevitable, and a tick-rate of 11 is quite unbearable on physics. Aside from that, here are some general tips:

  • Using ULX is fine if you store data in a database as opposed to a flat-file, and sync your data in chunks rather than constantly querying which will start to get backed up with a lot of players.
  • Make sure any addons that create ParticleEmitters or effects correctly destroy them when they’re done; that will fix most of the edict/UtilLinkedList overflow errors.
  • Evocity is definitely not the most optimised map, but it is quite open and flat which is something Source doesn’t handle well even in single-player. I would look into either hiring someone to optimise the map as best as possible, or switch to something smaller or at the very least, stylistically, more “restricted”
  • Heavily restrict wire and advdupe as there are many ways to spam or crash a server with them – it’s just the nature of having an addon that large
  • Not sure which cuffs addon you’re using, but if it is the one with the third-person cuff effect/expensive Think hooks, I would remove that portion of the addon
  • To fix your VCMod error, put a NULL entity check (if (entVariable ~= NULL) then) before whatever is on line 2.
  • Look into writing your own PlayerCanHearPlayersVoice hook as the one that comes with DarkRP is one of the most expensive functions.
  • If you’re not using widgets, I would recommend removing the PlayerTick “TickWidgets” hook for how much overhead it has.

Thanks code_gs I was hoping you were able to respond to this. So you think I should use MySQL for most of my data saving methods rather than data text files?

[editline]13th November 2016[/editline]

And would you suggest a different tickrate to prevent lag?

Yes, MySQL or SQLite is generally better than flatfile for big data management. You should work on optimising your code first, and then see how high you can push your tickrate while maintaining smooth server performance.

11 tickrate? How do you stand playing on that?

Alright thanks code_gs I have moved a lot of my files onto the MySQL storage and I have moved my tickrate to 16 for now! I also got rid of atlaschat and blogs as I saw that those are causing a lot of lag.

Also, an addon like FProfiler can show you what is hogging a lot of CPU time and where you should focus the most in trimming down fat. Then, though idk how stable it still is, you can use DBugr to see what is networking a lot.

I used both to figure out what is causing most of the lag