The Wildfly ManagedExecutorService behaves very unintuitively to the extend that I suspect the behaviour to be a bug (Wildfly 9, for what it's worth): it spawns core-size
threads, which it then uses to process the queue-size
'd queue. Even if max-size
is set, additional threads are not spawned, no matter how much work is in the queue.
That is, until the queue is completely full, at which point up to max-size
threads are spawned, but because by then the queue is so full, the newly spawned threads usually can't work it off before jobs get lost due to a maxed out queue.
Normal executor services instead tend to spawn max(max-size, available work)
threads, in other works, they spawn additional threads if max-size isn't reached if there is additional work available.
But I have been unable to configure the managed-executor-service
subsystem to provide such a behavior (while still having a job queue). The only alternative seems to be to set core-size to max-size, which is silly. Any hints ?
Aucun commentaire:
Enregistrer un commentaire