Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a Quart app benefit from using multiple workers?

I am trying out Quart with Hypercorn in Python 3.8. From what I understand, Quart is typically used for single threaded applications. But I see that Hypercorn has a --workers option to run the app.

workers      w, --workers      The number of workers to spawn and use.

How can a single threaded app benefit from using multiple workers?

like image 708
Rocket Avatar asked Oct 30 '25 04:10

Rocket


1 Answers

Each worker is a separate process which means that there are multiple Quart copies running when the worker option is used. This allows the connections to be distributed over the multiple processes, and hence gives more performance. Note that this trades off the ability to share data in memory, as each Quart copy is now independent.

like image 134
pgjones Avatar answered Oct 31 '25 17:10

pgjones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!