Closed jaemk closed 6 years ago
I definitely wonder what the performance impact of using a threadpool like Rayon would be. It could actually negatively impact performance since rouille
is synchronous and jobs could suffer starvation as the workers are busy waiting on the network... not actually using the processor at all. But, if the requests are short enough, it might speed things up since the overhead of spawning a new thread is removed.
However, I would kind of just like to see 2.0 go ahead and get released.
I'd also like to see 2.0 released soon. This could always be implemented without any breaking changes, leaving current Server
methods unchanged.
I do think it'd be an option worth adding though. For long running requests, the current model certainly ensures availability. I hacked in an optional threadpool last night and some basic load tests show a 2x performance increase for basic requests (that don't touch a database), and equal performance for database-limited queries.
Since we're talking breaking changes (#165), what are your opinions on adding an option to process requests in a thread pool? The default still being unlimited
thread:::spawn
s. TheServer
struct could also be made more "builder-y" in the process.