So I’ve recently noticed when we hit around 30 players, the server tends to lag during the process of players loading models/ulx/etc… as this process affects the server performance. So, I was wondering if anyone had any ideas for whether it’s possible to have a script which will manage all of that and will slow down the process of loading the models/materials/ulxcommands/donation system/etc slower which will hopefully increase the server performance during the time of those players joining? Thanks for any ideas.
I will try the FProfiler, all though, I’m unsure what it is. Thank you. And yes, the game does freeze for those who join awhile, however, it’s mainly other players which get impacted by those who join. It causes spike lag to other players whilst someone is joining (during the final stage of fully connecting to the server).
The rest of it is just usual addons which shouldn’t be causing any issues.
FProfiler will be your best bet. Open the menu and select “Server” in the top left, start the capture and get someone to join the server. After they have spawned in, stop FProfiler and sort the list by pressing the “Total time in ms (inclusive)” tab.
ULX has been known in the past to freeze servers upon someone joining, I’m pretty sure that was fixed a while back however.
Depends on how you store user data I believe. If ULX still just stores all the player group assignments in a single massive users.txt file then you’re boned unless you switch to SQL. I can’t remember though and my contact is AFK.
Could that be potentionally causing lag upon connection? If so, I’m more then happy to remove it, however, it’s quite useful of an addon when it comes to RP.
Switching to SQL lets you asynchronously read in user data in a fast and efficient way that will never lock up your server. Reading in and parsing a massive users.txt is slow and synchronous (halts the server until finished) and the bigger it gets the worse it will be. You will notice this issue quicker if your ULX setup assigns all new users to a default group since it adds every user whether or not they even ever come back.
Also when I say SQL I refer to something my mysqloo or tmysql4 (binary modules) which fully support async usages. The built in SQLite module does not have that functionality unfortunately.
Changing over to MySQL has reduced the major lag received upon connections, thank you all so much and I hope this thread could help someone else out there in the future.