[DiscordArchive] Eluna aside, isn't the worldserver itself one single thread? Across all maps?
[DiscordArchive] Eluna aside, isn't the worldserver itself one single thread? Across all maps?
Archived author: Honey • Posted: 2022-08-23T17:22:31.334000+00:00
Original source
Eluna aside, isn't the worldserver itself one single thread? Across all maps?
I read this
> old eluna + new eluna - 1 thread (otherwise old eluna crashes) - back at 2000 players again
as if eluna would add multithreading to the worldserver itself. But doesn't ONLY the lua state per map run on a thread each?
Archived author: <o> • Posted: 2022-08-23T17:23:15.304000+00:00
Original source
new eluna does not add multithreading to the server, it's already there but old eluna removes it so it can work at all
Archived author: <o> • Posted: 2022-08-23T17:23:15.620000+00:00
Original source
sec
![[Image: unknown.png?ex=690c31e6&is=690ae066&hm=7...91273d0c5&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688298923700325/unknown.png?ex=690c31e6&is=690ae066&hm=7d49513d11ff4a23de6254a351b535de293fec5e1fdfcc112acc3ae91273d0c5&)
Archived author: <o> • Posted: 2022-08-23T17:28:06.858000+00:00
Original source
this is how azerothcore updates the world normally (without eluna), from top to bottom. Stuff like commands, auction house and groups (stuff that works across maps essentially) happen on the "main thread" , then the thread "splits" into three (or more) to handle the expensive map updates. This is how it's possible to have crazy numbers of players like 6000+
![[Image: unknown.png?ex=690c31e6&is=690ae066&hm=7...91273d0c5&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688298923700325/unknown.png?ex=690c31e6&is=690ae066&hm=7d49513d11ff4a23de6254a351b535de293fec5e1fdfcc112acc3ae91273d0c5&)
![[Image: unknown.png?ex=690c321d&is=690ae09d&hm=b...64b286786&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688527349682286/unknown.png?ex=690c321d&is=690ae09d&hm=b40cec6955cae1087310323b7bef386abc83db2d1444eb44a85c76164b286786&)
Archived author: <o> • Posted: 2022-08-23T17:29:01.397000+00:00
Original source
this is what old eluna forces the server to do, because "map" updates fire lua events and singlestate lua crashes if multiple map updates tries to access it at the same time (those are not up/down arrows on the map updates i was just sloppy removing the other boxes)
![[Image: unknown.png?ex=690c321d&is=690ae09d&hm=b...64b286786&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688527349682286/unknown.png?ex=690c321d&is=690ae09d&hm=b40cec6955cae1087310323b7bef386abc83db2d1444eb44a85c76164b286786&)
![[Image: unknown.png?ex=690c3244&is=690ae0c4&hm=2...8010ed139&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688690382278716/unknown.png?ex=690c3244&is=690ae0c4&hm=24beba62b8d74c94ff7a86710e7446f1861b0b9444a94f1b1fd1ff48010ed139&)
Archived author: <o> • Posted: 2022-08-23T17:29:40.258000+00:00
Original source
but with multistate eluna, you can run things threaded again because each map has its own lua state now
![[Image: unknown.png?ex=690c3244&is=690ae0c4&hm=2...8010ed139&]](https://cdn.discordapp.com/attachments/448835144564867094/1011688690382278716/unknown.png?ex=690c3244&is=690ae0c4&hm=24beba62b8d74c94ff7a86710e7446f1861b0b9444a94f1b1fd1ff48010ed139&)
Archived author: <o> • Posted: 2022-08-23T17:32:56.755000+00:00
Original source
the reason this slows the server down so much normally is that pretty much **all** the really slow operations happen in map updates, so it really limits how many players you can have with it
Archived author: <o> • Posted: 2022-08-23T17:33:27.718000+00:00
Original source
so this is **not** because you have too many lua scripts or anything like that, but because having singlestate lua at all forces you to not multithread the slow parts of running the server. Singlestate eluna will take a server from handling like 6000 players down to 2000 with no scripts running at all
Archived author: <o> • Posted: 2022-08-23T17:34:20.525000+00:00
Original source
of course, lua itself _does_ have a performance impact too, but with normal usage it's nowhere close to this threading issue
Archived author: Honey • Posted: 2022-08-23T18:08:33.434000+00:00
Original source
That's good info, thanks for the explanation.