Jump to content

Multi-Core support on servers


Recommended Posts

Dear MTA Developers,

I believe I speak on behalf of every server owner when I say that multi-core support is something that is going to get required sooner or later.

Scripts keep expanding, using MySQL to store and receive data, making more server sided scripts.

These things put a gigantic load on the single-core MTA can utilise, meaning that it will start to lag at some point, and that's not really what you want with a lot of people on your server..

I realise that implenting multi-core support is a very big job, as the entire server platform has to be designed to work with multi-cores.

But the increase in performance on almost every server will be great, and it will mean that servers have to worry less about endless optimisations and focus on innovation and fixing more important things.

Thanks,

AeroXbird

Link to comment

I have a simple idea for script multithreading on both server and client: a Lua state for every thread. In addition to the main thread which runs MTA/GTA SA and Lua scripts, there could be 'secondary' threads running separate Lua states on different CPU cores. So one thread would still run synchronously with the game, while other threads run in parallel. A thread could be created from another thread using some scripting function.

However, I'm not sure how much the performance would be improved. Since Lua states do not share the variables, the data would have to be sent from one thread to another using signals (another scripting function) and that means copying as much data as there is sent. If lots of calculations are done on small amount of data, then it's fine. But if you do very simple operations on lots of data, it will be useless, since the time spent on sending data from one thread to another could be used by performing the operation on one thread.

In conclusion, script multithreading could be done, but it would have limited functionality, resulting in reduction of performance gain.

Link to comment
  • 2 weeks later...
  • 2 weeks later...
This would be one of the best features for the MTA server of all time if it ever gets implemented.

This multi-core system should also be toggleable via mtaserver.conf.

I do agree with these two points, and also multi threading capabilities in Lua resources.

Perhaps a system similar to this?

Link to comment
  • 5 years later...
  • 3 months later...
On 01/09/2018 at 10:08, PolskiSebek12 said:

that been 5 years ago, do now it is possible ?

MTA server has 4 threads: Main, sync, raknet and database. Although this doesn't mean it could completely use up 100% of a CPU's power, it doesn't need to because there are no servers popular enough to be affected by this. The record for online players on 1 server is 1400 and that server did not even lag during that insane peak, this was thanks to all the effort ccw made optimizing MTA server and the semi multi threaded support it has. Also efficient scripts help which again is thanks to ccw's performancebrowser which allows scripters to see what needs optimizing.

It is client performance that is much more of a problem now. Many of us have modern PC's that can play GTA V on high and have stable 60 FPS yet on MTA servers with many objects, vehicles and players around we can get as low as 30 FPS. Those with older PC's don't stand a chance.

Link to comment
  • Recently Browsing   0 members

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