[Twisted-Python] 100% CPU on high opened descriptors
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets). It seems TM isn't closing some connections when clients loose connection to the server. I have no more than 200 simultaneous clients, each of then using a single connection. Any idea why those connections remain open? Regards
On Apr 26, 2011, at 11:42 AM, Juan Antonio Ibañez Santorum wrote:
I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets). It seems TM isn't closing some connections when clients loose connection to the server. I have no more than 200 simultaneous clients, each of then using a single connection. Any idea why those connections remain open?
This is a bug that somebody should really fix. <http://tm.tl/816> To work around it, however: if a connection is closed "uncleanly" (for example: you close your laptop, you rip the ethernet cable out of the wall, you foolishly give your computer to zooko for a minute), and no traffic is going in either direction, it will remain "open" as far as the server is concerned, forever. If you send a little bit of traffic (an application-level ping) to each client every so often, the server's TCP stack will notice that nobody is acknowledging it and eventually time them out and close the connections. Alternately, you could fix an even older bug, <http://tm.tl/78>, which would allow you to immediately terminate "dead" connections without waiting for them to time out. Good luck, -glyph
On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here. In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command. -- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd. Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting Phone: +447791750420
----- Original Message -----
From: "Luke Marsden" <luke-lists@hybrid-logic.co.uk> To: "Twisted general discussion" <twisted-python@twistedmatrix.com> Sent: Tuesday, April 26, 2011 2:08:40 PM Subject: Re: [Twisted-Python] 100% CPU on high opened descriptors On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
I assume that using a reverse proxy (Apache, nginx, etc.) in front of Twisted removes this problem? (or at least displaces it from being Twisted's problem to being the proxies problem.) Is it recommended to always run Twisted behind a proxy? We've been doing that simply to offload delivery to the final client, but I'm thinking it may have a more general need. --Ray
On Apr 26, 2011, at 4:34 PM, Ray Cote wrote:
----- Original Message -----
From: "Luke Marsden" <luke-lists@hybrid-logic.co.uk> To: "Twisted general discussion" <twisted-python@twistedmatrix.com> Sent: Tuesday, April 26, 2011 2:08:40 PM Subject: Re: [Twisted-Python] 100% CPU on high opened descriptors On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
I assume that using a reverse proxy (Apache, nginx, etc.) in front of Twisted removes this problem? (or at least displaces it from being Twisted's problem to being the proxies problem.)
Is it recommended to always run Twisted behind a proxy?
No. It's recommended to fix bugs in Twisted that affect you :). And besides, this problem is not specific to HTTP; it affects any Twisted service that runs on a port, so there are lots of uses of Twisted where you can't run Twisted behind a proxy. Plus, this affects clients as well; if you have a twisted spidering application, your client connections could get into this same state. It's possible to handle this sort of attack without any changes to Twisted, by carefully monitoring the number of connections you have open. Of course most people just crank up their ulimits and forget about it.
We've been doing that simply to offload delivery to the final client, but I'm thinking it may have a more general need.
If you have to do it anyway then the discussion is somewhat academic, isn't it? :)
No. It's recommended to fix bugs in Twisted that affect you :). Well, that too. :}
Is that the unique way to get mor than 1024 simultaneous connections? Regads 2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk>
On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here.
In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk> You can also switch to using the "poll" reactor
On Wed, 2011-04-27 at 08:01 +0200, Juan Antonio Ibañez Santorum wrote:
Is that the unique way to get mor than 1024 simultaneous connections?
Regads
On Linux and BSD, yes. See http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html for all the options for different platforms. -- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd. Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting Phone: +447791750420
Must I make any change appart from start the app with twistd plus '-r poll'? 2011/4/27 Luke Marsden <luke-lists@hybrid-logic.co.uk>
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk> You can also switch to using the "poll" reactor
On Wed, 2011-04-27 at 08:01 +0200, Juan Antonio Ibañez Santorum wrote:
Is that the unique way to get mor than 1024 simultaneous connections?
Regads
On Linux and BSD, yes. See http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.htmlf... all the options for different platforms.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
That is sufficient, yes. You might even want to make that 'epoll' since it scales better than poll (assuming you're running on Linux 2.6+ only) Best, Patrick 2011/4/27 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>:
Must I make any change appart from start the app with twistd plus '-r poll'?
2011/4/27 Luke Marsden <luke-lists@hybrid-logic.co.uk>
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk> You can also switch to using the "poll" reactor
On Wed, 2011-04-27 at 08:01 +0200, Juan Antonio Ibañez Santorum wrote:
Is that the unique way to get mor than 1024 simultaneous connections?
Regads
On Linux and BSD, yes. See
http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html for all the options for different platforms.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Thank you very much for your tip Patrick! 2011/4/27 Patrick Mylund Nielsen <twisted@patrickmylund.com>
That is sufficient, yes.
You might even want to make that 'epoll' since it scales better than poll (assuming you're running on Linux 2.6+ only)
Best, Patrick
Must I make any change appart from start the app with twistd plus '-r
2011/4/27 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>: poll'?
2011/4/27 Luke Marsden <luke-lists@hybrid-logic.co.uk>
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk> You can also switch to using the "poll" reactor
On Wed, 2011-04-27 at 08:01 +0200, Juan Antonio Ibañez Santorum wrote:
Is that the unique way to get mor than 1024 simultaneous connections?
Regads
On Linux and BSD, yes. See
http://twistedmatrix.com/documents/current/core/howto/choosing-reactor.html
for all the options for different platforms.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
I had got the same problem using '-r epoll' options when starting the app via twistd... When 1024 descriptors are opened, I can see 100% CPU. Any ideas? 2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk>
On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here.
In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
2011/5/5 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
I had got the same problem using '-r epoll' options when starting the app via twistd... When 1024 descriptors are opened, I can see 100% CPU.
Any ideas?
1. Edit /etc/sysctl.conf and place the following line there: fs.file-max = 999999 2. Type $ sudo sysctl -p 3. Place the following two lines: * soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999` 4. Check that $ ulimit -a shows your open fixes set to 999999 There's nothing special about 999999 - it's just some big number conveniently bigger than 1024. Enjoy. Reza -- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
On May 5, 2011, at 10:52 AM, Reza Lotun wrote:
2011/5/5 Juan Antonio Ibañez Santorum <juanito1982@gmail.com> I had got the same problem using '-r epoll' options when starting the app via twistd... When 1024 descriptors are opened, I can see 100% CPU.
Any ideas?
1. Edit /etc/sysctl.conf and place the following line there: fs.file-max = 999999 2. Type $ sudo sysctl -p 3. Place the following two lines: * soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999` 4. Check that $ ulimit -a shows your open fixes set to 999999
There's nothing special about 999999 - it's just some big number conveniently bigger than 1024. Enjoy.
Reza
Would you mind opening a doc bug for explaining how to do this on multiple platforms, and maybe writing a lore doc about it? This is a really important tuning thing for anyone wanting to run even a medium-scale Twisted service. (Also, once again, the bug is <http://twistedmatrix.com/trac/ticket/816>, somebody please fix it :).) -glyph
Thank you Reza! 2011/5/5 Reza Lotun <rlotun@gmail.com>
2011/5/5 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
I had got the same problem using '-r epoll' options when starting the app via twistd... When 1024 descriptors are opened, I can see 100% CPU.
Any ideas?
1. Edit /etc/sysctl.conf and place the following line there: fs.file-max = 999999 2. Type $ sudo sysctl -p 3. Place the following two lines: * soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999` 4. Check that $ ulimit -a shows your open fixes set to 999999
There's nothing special about 999999 - it's just some big number conveniently bigger than 1024. Enjoy.
Reza
-- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Small addition - I forgot to say to open /etc/security/limits.conf and then place the following two lines in step 3 in: 3. Place the following two lines:
* soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999`
Also, I'd be happy to contribute a TCP tuning note to the Twisted docs. These are absolutely essential for any production deploy. Thanks, Reza -- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
MUST I apply that change or may be I SHOULD do it? Why is it necessary? Regards 2011/5/6 Reza Lotun <rlotun@gmail.com>
Small addition - I forgot to say to open /etc/security/limits.conf and then place the following two lines in step 3 in:
3. Place the following two lines:
* soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999`
Also, I'd be happy to contribute a TCP tuning note to the Twisted docs. These are absolutely essential for any production deploy.
Thanks, Reza
-- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Hi Juan, 2011/5/8 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
MUST I apply that change or may be I SHOULD do it? Why is it necessary?
Each network connection on your system is represented by a 'file descriptor', in Unix terminology. By default, there is a limit on the number of open file descriptors that can be opened at once, which is a little different for every system (usually its 1024 or 4096), even though the system is actually capable of opening more network connections. This limit is set in two places - systemwide and per-user. To run a network server you have to increase the limits both in the kernel and for the user the network process is running as. The 'sysctl' steps I previously mentioned increases the limits for the kernel, and the 'ulimit' steps for the user. In the example I gave, this limit was increased to 999999 which is extremely high, and should be suitable for almost all production server deployments. sysctl limits can be set permanently by editing /etc/sysctl.conf with new kernel settings and then running 'sysctl -p'. ulimits can be changed at runtime - the 'nofile' setting can be set by 'ulimit -n', or permanently by editing /etc/security/limits.conf and rebooting/opening a new login shell. Hope that clears it up. Reza -- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
+1 Perfect explanation. Thank you very much! 2011/5/8 Reza Lotun <rlotun@gmail.com>
Hi Juan,
2011/5/8 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
MUST I apply that change or may be I SHOULD do it? Why is it necessary?
Each network connection on your system is represented by a 'file descriptor', in Unix terminology. By default, there is a limit on the number of open file descriptors that can be opened at once, which is a little different for every system (usually its 1024 or 4096), even though the system is actually capable of opening more network connections.
This limit is set in two places - systemwide and per-user. To run a network server you have to increase the limits both in the kernel and for the user the network process is running as. The 'sysctl' steps I previously mentioned increases the limits for the kernel, and the 'ulimit' steps for the user. In the example I gave, this limit was increased to 999999 which is extremely high, and should be suitable for almost all production server deployments.
sysctl limits can be set permanently by editing /etc/sysctl.conf with new kernel settings and then running 'sysctl -p'. ulimits can be changed at runtime - the 'nofile' setting can be set by 'ulimit -n', or permanently by editing /etc/security/limits.conf and rebooting/opening a new login shell.
Hope that clears it up.
Reza -- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Still having problems... I can see that twistd process has a higher number than 1024 looking at /proc/pid/limits but whe 1024 descriptors number gets reached the system becomes unstable. It also has been launche using '-r epoll' option. Any other idea? 2011/5/5 Reza Lotun <rlotun@gmail.com>
2011/5/5 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
I had got the same problem using '-r epoll' options when starting the app via twistd... When 1024 descriptors are opened, I can see 100% CPU.
Any ideas?
1. Edit /etc/sysctl.conf and place the following line there: fs.file-max = 999999 2. Type $ sudo sysctl -p 3. Place the following two lines: * soft nofile 999999 * hard nofile 999999 Either reboot, or also type in `ulimit -n 999999` 4. Check that $ ulimit -a shows your open fixes set to 999999
There's nothing special about 999999 - it's just some big number conveniently bigger than 1024. Enjoy.
Reza
-- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Hmm, are you running your process as root? If so, you may need to add the following two lines in /etc/security/limits.conf: root soft nofile 999999 root hard nofile 999999 (yes, root, even though you previously supplied '*'). I'd also reboot just to be sure. If you still have trouble after that, then perhaps it's something to do with your code. Reza 2011/5/10 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>
Still having problems... I can see that twistd process has a higher number than 1024 looking at /proc/pid/limits but whe 1024 descriptors number gets reached the system becomes unstable. It also has been launche using '-r epoll' option. Any other idea?
-- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
Still having problems...
I can see that twistd process has a higher number than 1024 looking at /proc/pid/limits but whe 1024 descriptors number gets reached the system becomes unstable. It also has been launche using '-r epoll' option. Any other idea?
0. What does "unstable" mean? 1. There may be user-specific limits in addition to OS-level limits. Did you use "ulimit -n" to raise that limit? 2. Are you using processes on a version of Linux older than 2.6.11? http://twistedmatrix.com/trac/ticket/918
2011/5/10 Itamar Turner-Trauring <itamar@itamarst.org>
Still having problems...
I can see that twistd process has a higher number than 1024 looking at /proc/pid/limits but whe 1024 descriptors number gets reached the system becomes unstable. It also has been launche using '-r epoll' option. Any other idea?
0. What does "unstable" mean?
I started to see an incrment on memory usage and stopping to accept new connections. I had to restart the app as it is running in a production enviroment.
1. There may be user-specific limits in addition to OS-level limits. Did you use "ulimit -n" to raise that limit?
Yes, and I checked the limit was ok looking at /proc/pid/limits
2. Are you using processes on a version of Linux older than 2.6.11?
No. 2.6.34 on a Centos distro.
Is there any way to check if it is using the the poll/epoll reactor? Regards 2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk>
On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here.
In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Can you not do a: from twisted.python import log from twisted.internet import reactor log.msg('My reactor is: %r' % repr(reactor)) somewhere in your code to determine it? Are you running your application with twistd? You can pass a reactor implementation via the '-r' option. Reza 2011/5/19 Juan Antonio Ibañez Santorum <juanito1982@gmail.com>:
Is there any way to check if it is using the the poll/epoll reactor? Regards
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk>
On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote:
Hello! I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here.
In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Reza Lotun mobile: +44 (0)7521 310 763 email: rlotun@gmail.com work: reza@tweetdeck.com twitter: @rlotun
Hi Juan, You could try: print reactor.__class__ This should allow you to check that the twistd command-line argument is working. Example: luke@pow:~$ twistd -noy foo.py |head -n 1 <class 'twisted.internet.selectreactor.SelectReactor'> luke@pow:~$ twistd -r poll -noy foo.py |head -n 1 <class 'twisted.internet.pollreactor.PollReactor'> luke@pow:~$ cat foo.py from twisted.internet import reactor from twisted.application import service print reactor.__class__ application = service.Application("nothing") -- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd. Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting Phone: +447791750420 On Thu, 2011-05-19 at 21:57 +0200, Juan Antonio Ibañez Santorum wrote:
Is there any way to check if it is using the the poll/epoll reactor?
Regards
2011/4/26 Luke Marsden <luke-lists@hybrid-logic.co.uk> On Tue, 2011-04-26 at 17:42 +0200, Juan Antonio Ibañez Santorum wrote: > Hello! > I have a Linux box serving my twisted app. All works ok except > after some days running (where I can see my CPU going to 100%). I saw > that CPU goes 100% usage when the app reaches to 1024 opened > descriptors (sockets).
You can also switch to using the "poll" reactor, which will allow you to sustain more than 1024 connections. You should still figure out what is keeping your connections open and find a way to reap them however, as this will just delay the problem. As Glyph suggested an application level "ping" may help here.
In the mean-time you can switch to the poll reactor by adding "-r poll" to your twistd command.
-- Best Regards, Luke Marsden CTO, Hybrid Logic Ltd.
Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting
Phone: +447791750420
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (7)
-
Glyph Lefkowitz
-
Itamar Turner-Trauring
-
Juan Antonio Ibañez Santorum
-
Luke Marsden
-
Patrick Mylund Nielsen
-
Ray Cote
-
Reza Lotun