Re: Thread Consumption Problem in Daemon?

Glyph <[email protected]>
Newsgroups gmane.comp.python.twisted
Message-ID <[email protected]>
> On Nov 19, 2018, at 6:16 AM, Darren Govoni <[email protected]> wrote:
> 
> I tried to find out if there is a way to limit the thread pool size from command line for twisted web and found nothing. Does it exist?

The thread pool is limited to 10. While this is configurable via the API, no command line option is exposed to tune it.  (This would be a great contribution if you were so inclined!)

It seems likely to me that Flask is spawning background threads for some reason; given the way Twisted's threadpool works, leaks like this are not common.  However, anything is possible: you probably want to gather some information about what all those threads are doing.

Can you add a route to your Flask application to call https://docs.python.org/3/library/faulthandler.html#dumping-the-traceback <https://docs.python.org/3/library/faulthandler.html#dumping-the-traceback> and then save the output somewhere?  That will at least give you a hint as to whether Twisted's threadpool is at fault, and if it is, what it is blocked doing.

-g

_______________________________________________
Twisted-Python mailing list
[email protected]
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.