Jump to content

Server lagging


DRW

Recommended Posts

Hi there,

So I am having a big problem, and I wish to know to what resource this problem is related. First of all, my server is 12GB RAM, 2x2.5Ghz and 100mbps. The problem is... My players start lagging when the player count reaches around 45-50 players. About lag, I mean there's a delay when you want to get in a car, reload, kill, etc. of like 0.5 seconds, it obviously increases when there are 70 players, which makes the server impossible to enjoy.

Let me show you some stats about the general usage:

3ae57ca0f5067587b3aaf08c985a6073.png

So... Yeah... About the traffic usage, I have a server which has ~350-500 zombies (20% CPU usage) and ~50 miscellaneous bots (7% CPU usage), so there's the explanation.

I'm supposed to have 100mbps bandwidth, but I have an average of 40mbps anyway, so I don't know if that's the problem or what.

What do you say? Is it possible that MTA is not using both cores? Or is it the bandwidth in the first place?

 

Link to comment

Well its common Idk how to fix this becoz it happens for all server which have 100+players yea some times host location will effect the server to get lag,model skins ,player ping which makes server lag,I suggest u to down the skins,vehicles which are large ,some server use kick low ping system which reduce lag for them I wish there is a way to remove lag !!

Link to comment
6 hours ago, MadnessReloaded said:

Hi there,

So I am having a big problem, and I wish to know to what resource this problem is related. First of all, my server is 12GB RAM, 2x2.5Ghz and 100mbps. The problem is... My players start lagging when the player count reaches around 45-50 players. About lag, I mean there's a delay when you want to get in a car, reload, kill, etc. of like 0.5 seconds, it obviously increases when there are 70 players, which makes the server impossible to enjoy.

Let me show you some stats about the general usage:

3ae57ca0f5067587b3aaf08c985a6073.png

So... Yeah... About the traffic usage, I have a server which has ~350-500 zombies (20% CPU usage) and ~50 miscellaneous bots (7% CPU usage), so there's the explanation.

I'm supposed to have 100mbps bandwidth, but I have an average of 40mbps anyway, so I don't know if that's the problem or what.

What do you say? Is it possible that MTA is not using both cores? Or is it the bandwidth in the first place?

 

Upgrade your processor, you need more cores. Check the processor usage, its quite high. Though you have so much RAM which is not much needed.

Link to comment
1 hour ago, MadnessReloaded said:

But it's mostly at 50% usage, shouldn't it be enough?

Processor at 50% Usage is very high. Some VPS providers even suspend the VPS for more than 20% Constant CPU Usage. Two cores are very less for a game server with many players. I used to run my old game server, that is 3 years ago on just one core with 512 MB RAM. Heavy weight server, could get up to 20-25 players without lag. The lag would mostly start after 25 players.

  • Thanks 1
Link to comment
12 minutes ago, Lampard1 said:

Processor at 50% Usage is very high. Some VPS providers even suspend the VPS for more than 20% Constant CPU Usage. Two cores are very less for a game server with many players. I used to run my old game server, that is 3 years ago on just one core with 512 MB RAM. Heavy weight server, could get up to 20-25 players without lag. The lag would mostly start after 25 players.

I see, well, will it make a difference if I switch from 2.5Ghz to 3.1Ghz per core or will I have to switch to 4 cores directly?

Link to comment
  • MTA Anti-Cheat Team

In my experience, a server can still be at 20% CPU usage (on the server process) with about 130 players connected, and because you're at 60% with just 50 players, something is terribly wrong; your scripts, even when it's not mods or alot of peds to sync (the zombies you mentioned) can be the problem, when it's inefficiently coded. For more on that, refer to: https://forum.multitheftauto.com/topic/100452-tips-to-reduce-lag-on-a-crowded-server/?do=findComment&comment=883432

There's even ways for a simple script to instantly use 70% server CPU or totally freeze it up, by just one line of code written by someone not thinking too much, or habitual choices at several places in the script where it routinely performs a very performance-inefficient procedure. For example if you are keeping track of data from all those 50 players at once and constantly, or looping all of them with a short interval, no doubt it will be resource-intensive.

I would advise you to take a look at performancebrowser in webadmin or the ingame official resource ''ipb'' (ingame performance browser) when it starts lagging, so you can see if some resources are using up performance intensively, and pin down any possible culprit. Also you mentioned having ''350-500 zombies'' on the server, you might want to see if you can optimize their sync, and play around with the sync intervals in mtaserver.conf, Ped sync interval shouldn't be too low when you gotta sync this amount of zombies, as you can imagine what'll happen then. IPB will also provide more information about syncing expenses and how other factors account for a share of the server load.

If you're not already using 64-bit MTA server, this is a good moment to switch, as it will leverage all server cores and memory. (get it from https://nightly.multitheftauto.com/)

@MadnessReloaded

  • Thanks 1
Link to comment
13 minutes ago, Dutchman101 said:

In my experience, a server can still be at 20% CPU usage (on the server process) with about 130 players connected, and because you're at 60% with just 50 players, something is terribly wrong; your scripts, even when it's not mods or alot of peds to sync (the zombies you mentioned) can be the problem, when it's inefficiently coded. For more on that, refer to: https://forum.multitheftauto.com/topic/100452-tips-to-reduce-lag-on-a-crowded-server/?do=findComment&comment=883432

There's even ways for a simple script to instantly use 70% server CPU or totally freeze it up, by just one line of code written by someone not thinking too much, or habitual choices at several places in the script where it routinely performs a very performance-inefficient procedure. For example if you are keeping track of data from all those 50 players at once and constantly, or looping all of them with a short interval, no doubt it will be resource-intensive.

I would advise you to take a look at performancebrowser in webadmin or the ingame official resource ''ipb'' (ingame performance browser) when it starts lagging, so you can see if some resources are using up performance intensively, and pin down any possible culprit. Also you mentioned having ''350-500 zombies'' on the server, you might want to see if you can optimize their sync, and play around with the sync intervals in mtaserver.conf, Ped sync interval shouldn't be too low when you gotta sync this amount of zombies, as you can imagine what'll happen then. IPB will also provide more information about syncing expenses and how other factors account for a share of the server load.

If you're not already using 64-bit MTA server, this is a good moment to switch, as it will leverage all server cores and memory. (get it from https://nightly.multitheftauto.com/)

@MadnessReloaded

Really fun for you to just say it, I have removed Slothbot's zombie gamemode from my server and developed my own zombie AI some hours ago and the server went from 50% usage to 20% because of obvious resource-instensive functions. It does not lag one bit anymore, and I still got to remake my 1.5 year-old bot AI script. Now I'm currently having 72 players and everything works like a charm.

Thank you all very much, I'll consider paying a better VPS with at least some more Ghz and I will definitely consume my soul optimizing all my broken scripts. Have a really nice day (or night).

Edited by MadnessReloaded
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...