Thread Consumption Problem in Daemon?

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

Name:   twistd
Umask:  0077
State:  S (sleeping)
Tgid:   54855
Ngid:   35415
Pid:    54855
PPid:   1
TracerPid:      0
Uid:    4052    4052    4052    4052
Gid:    4052    4052    4052    4052
FDSize: 256
Groups: 4052
VmPeak: 34240104 kB
VmSize: 34239336 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:   1942708 kB
VmRSS:   1871884 kB
RssAnon:         1834800 kB
RssFile:           37080 kB
RssShmem:              4 kB
VmData: 33310576 kB
VmStk:       284 kB
VmExe:         4 kB
VmLib:    234176 kB
VmPTE:      8876 kB
VmSwap:        0 kB
Threads:        504
SigQ:   1/1546652
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001007
SigCgt: 00000001800146e8
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp:        0
Speculation_Store_Bypass:       thread vulnerable
Cpus_allowed:   ffffff,ffffffff
Cpus_allowed_list:      0-55
Mems_allowed:
 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003
Mems_allowed_list:      0-1
voluntary_ctxt_switches:        358534596
nonvoluntary_ctxt_switches:     31738

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