bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.37k stars 1.46k forks source link

Advice on running Bottle on Windows #1199

Closed apournaras closed 3 years ago

apournaras commented 4 years ago

Hi, I am running a REST web service on a windows 10 PC that gets some decent traffic, but nothing extreme. I am using twisted as a WSGI server. I am running everything on conda. The issue I am having is that sometimes the web service freezes, it doesn't process any new requests. I am having this problem for a long time and every time I am forced to restart the service as I can't figure out what goes wrong. Has anyone experienced anything similar on Windows? What is a good solution for a production-ish use of bottle with Windows?

syegulalp commented 4 years ago

It's been a while since I did this, but if you're using WSGI in conjunction with IIS, it's likely that the IIS threadpool is being exhausted. How are you hosting Bottle?

apournaras commented 4 years ago

I am not using IIS. I am only using twisted with Bottle

defnull commented 3 years ago

The default thread-pool created by bottle for twisted has 5 to 20 threads. If you are blocking 20 threads, no new requests can be handled. Slow or misbehaving clients, or unhandled errors might also cause the server to stop responding. But this is a question besser suited for a twisted mailing-list or forum. Bottle is 'just' a WSGI framework and does not manage or create threads on its own.