Re: Thread Consumption Problem in Daemon?

Darren Govoni <[email protected]>
Newsgroups gmane.comp.python.twisted
Message-ID <CAN-ZBUc6-X=Ve84kb7Xkrt3CRrj0mt25U-tkyZasaeKYGqUj5w@mail.gmail.com>
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?

On Mon, Nov 19, 2018 at 8:30 AM Jean-Paul Calderone <
[email protected]> wrote:

> On Mon, Nov 19, 2018 at 8:26 AM Maarten ter Huurne <[email protected]>
> wrote:
>
>> On maandag 19 november 2018 12:40:20 CET Darren Govoni wrote:
>> > Hi,
>> >   I am using twisted to run my Flask app via WSGI like so.
>> >
>> > twistd --pidfile $PORT/pidfile -l $PORT/logfile  -n web --port
>> > tcp:$PORT --wsgi my.app
>> >
>> > Naturally, I have functions representing routes that enter and exit
>> > just fine.
>> >
>> > However, I notice the twisted daemon process is :"gathering threads".
>> > Eventually system runs out of them.
>> >
>> >  Here's a full status for one twisted server. 504 threads???
>>
>> I have a server running inside twistd which uses exactly 1 thread after
>> running for a few weeks, so the problem may not be in twistd itself.
>>
>> I'm using a reverse-proxy HTTP setup though, not WSGI. Maybe the problem
>> is specific to WSGI, Flask or your application?
>>
>
>
> Twisted's WSGI support definitely uses threads (as this is essentially a
> requirement of WSGI).  It uses the reactor thread pool (if you launch it
> from the CLI with twistd) which used to be limited to 10 threads.  I don't
> know if the same limit is in place these days.
>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> [email protected]
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>

_______________________________________________
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.