Discussion in 'Development' started by Hipster, Nov 4, 2017.
should we do everything async? commands? teleporting? events? or only internet stuff?
No, no, no, no.
First of all, I'd like to bust the rumors that asynchronous is faster. There's no point whatsoever to do everything async because it isn't faster.
Secondly, if everything is async, nothing I'd async because there is no main thread. So that's just nonsense.
Thirdly, you don't execute code asynchronously because it's faster, but because a part of code takes a very long time to complete. Think of huge loops, queries and similar.
Apart from those points, doing loads of things asynchronously is also a pain for plugin developers.
This class can Execute asynchronous tasks in the background.
It can fork a parallel process and call a function of the class that will execute the task code.
The parallel task can take given parameters from the originating process. Property values may also be shared with the parallel task using shared memory.
Note that that link is not the Pocketmine implementation. The Pocketmine implementation is based on workers from pthreads, which execute tasks asynchronously.
So how do i decrease server load? 80 player's can't even play survival without making the server(pocketmine) lag while lifeboat etc handler thousands of players... howww?
use multiple servers, optimize your plugins!
i use sqlite3
Lifeboat uses Steadfast 2, a stripped version of Pocketmine where everything they didn't need is removed. Which is a lot. Secondly, Lifeboat has Loads of servers, not just one. SQLite won't magically make your server fast or something, lifeboat just shares a database like MySQL for all servers.
i can't transfer data between servers
Then work on other things that make your server lag. You can use timings (/timings on, /timings paste) to check the cause of these.
Full server tick, Player network send, player network receive, player order chunks, player send chunks, tick entity, entityMove also timings.pmmp.io doesn't work says 403 forbidden nginx/1.11.12, i used ubuntu one for this
I use MySQL database to transfer datas and options/preferences of the player i recommend to use that and create multiple servers this can reduce lag too of your network.
Yea well i didn't know about it back then so now i'm stuck
Separate names with a comma.