Jump to content

A way to resolve lag caused by resources?


Recommended Posts

Posted

Hello,

Ever since I joined MTA from the veryu beginning, my main interest were Roleplay servers. I joined a few in the past, but they all got the exact same problems.

The longer the server is up, the more data it stores. The more data the server get's , the longer it takes for it to load. Everyone knows that.

But what really pisses people off is that it affects the overall gameplay.

For example:

I've been in MTA:RP for almost a year. And I see the performance of the server going backwards even though we have upgraded our server. With a new CPU you'd think the lag would reduce. Now I know that my laptop isn't the greatest to play GTA in the first place, but when I joined the common Race, RPG, zombie, freeroam server. My Framerate got up to 45 - 60 while in my own server I get nothing more then 9-10 on average.

Other then the server has been DDoSsed and is still a target of the attackers (and I know we are not the only one being DDoSsed, I've seen a lot of servers going down by DDoSSers). Even without those stupid attacks, the server lags.

Recently I have checked the items the server has. It's over 230,000 items. A lot of them are gone, but our MySQL still reads through all those lists.

As I fear, there are a lot of scripts in various resources who have endless loops in them. Yes I want to get rid of them, but I need to select it carefully. But what I am looking for is the following:

- A way to end the lag caused by the scripts

- A solution to the unnessesary data checking.

- A way to get rid of memory occupied useless scripts.

We use MySQL

How can I resolve & figure out what scripts are pretty much useless yet the players do not suffer from it?

For the ones interested, here I monitored the timer.log for approx 20-30 minutes. I couldn't upload it to pastebin since it's over 500 kb.

http://puu.sh/29SA5

Posted

if you got XML files, that save data in them, it might be one problem, because as far as i seen on other topics, people were saying that XML files have limited amount of data that they can save then they get laggy

Posted

We got xml files for things such as manuals, help commands and a few items use them to store data like notes. biggest files are less then 200 kb and we have a total of 588 files, the majority are under 66 kb

Posted

What i know is that scripts with lots of triggers and/or timers make lag ..

Check if any of your resources got so many triggers and/or timers ..!

Posted

From what i've heard from the developers of the script, there's a lot of them in some resources like payday, also with the use of world-items trying to render everything to the player. That's what is causing the lag. So I might need to figure out a way to reduce the amount of timers, it'll require some tiem & research I guess.

  • Moderators
Posted

or overfull tables and to much element data. (If the server never get restarted.)

also, mta just get heavier and most of the pc's get older.

Posted

There are over 8000 items in the resources (images, xml files, lua files, etc) it takes up to 189Mb. On my development server I don't get any lag for good reasons. but if that's turned to a public server, overtime I will get the same results.

Posted

Improving the code itself will help, avoid using much timers and anything that uses bandwidth (events, remote calls, element data) and mainly XML, unless it's really needed. They're small files, but they're much - it ends up doing the same AFAIK. I would recommend using SQLite or MySQL (if really needed).

Posted

We're using MySQL to connect to our UCP. the xml files are mainly used to log a lot of chats.

A lot of timers are used for things like paydays. reviewing all the script requires a lot of work, figuring out a good alternative might be harder.

Posted

Well, It's going to take a long time since I'm not that experienced in coding. Right now i'm tweaking around a bit. When I get the hand of it and everything works and it does fix those timer issues. i'd put it in.

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...