performance: async worker threads #6417
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#6417
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
i've got an idea. i think the reason why server performance has been bad when there's lots of players and spawnit is running, is that "The engine will scale the amount of worker threads automatically". there's no way to specify a maximum number of threads. i think this eventually causes the async worker threads to starve the main server process - lag gets bad not because the main thread is trying to do too much, but because there's just not enough available CPU time given the competing processes. i'm not sure how to adapt to that, will try talking to the core devs.
yeah, verified that the max value is the number of "processors" (i.e. the number listed in /proc/cpuinfo). particularly, with cpu-bound tasks on a processor with hyperthreading, this over-allocates resources even without accounting for the main processing thread. then there's also the mapgen threads, and the database, and whatever else the system is trying to do...
thinking more, this is still weird, as spawnit limits the number of jobs queued for async processing. it still shouldn't depend on the number of players...
note to self: try tweaking
max_queue_size
from 300 to 30 when the server is busy, and see if that does anything.Feel free to add any logging or ask me for readouts of whatever linux has in the toolbox to see what's happening. Looking at htop, yes, sometimes all processes are a bit busy, but the machine is far from its limit.
i tried tweaking that and a couple other parameters while the server was running, and it had no effect on average dtime. not every setting can currently be changed on the fly, though.
yeah, that seems to indicate this theory is wrong.
Is there a command that would stop the entire spawnit process and empty the queue? With this command we could 100% prove it's spawnit - or not.
it doesn't empty the queue, but w/ the next update, spawnit will have a command to totally disable all its major actions.
disabling spawnit completely and letting the queue run out doesn't result in any significant effect on lag. i didn't run statistics, and it varies a lot from moment to moment, but it generally varied within the same bounds, just watching the numbers. i ran the tests several times in both moderate (ratio of ~5) and high (ratio of 20 or more) lag.
so i'm closing this as "can't reproduce".