<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 5, 2011, at 10:52 AM, Reza Lotun wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">2011/5/5 Juan Antonio Ibaņez Santorum <span dir="ltr">&lt;<a href="mailto:juanito1982@gmail.com">juanito1982@gmail.com</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
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.&nbsp;<div><br></div><div>Any ideas?<br><br></div></blockquote><div><br></div>
<div>1. Edit /etc/sysctl.conf and place the following line there:</div><div>&nbsp; &nbsp; &nbsp; &nbsp;fs.file-max = 999999</div><div>2. Type $ sudo sysctl -p</div><div>3. Place the following two lines:</div><div><div>* &nbsp; &nbsp; &nbsp; soft &nbsp; &nbsp;nofile &nbsp; &nbsp; &nbsp;999999</div>
<div>* &nbsp; &nbsp; &nbsp; hard &nbsp; &nbsp;nofile &nbsp; &nbsp; &nbsp;999999</div></div><div>Either reboot, or also type in `ulimit -n 999999`</div><div>4. Check that $ ulimit -a shows your open fixes set to 999999</div><div><br></div><div>There's nothing special about 999999 - it's just some big number conveniently bigger than 1024. Enjoy.</div>
<div><br></div><div>Reza</div></div></blockquote><br></div><div>Would you mind opening a doc bug for explaining how to do this on multiple platforms, and maybe writing a lore doc about it? &nbsp;This is a really important tuning thing for anyone wanting to run even a medium-scale Twisted service.</div><div><br></div><div>(Also, once again, the bug is &lt;<a href="http://twistedmatrix.com/trac/ticket/816">http://twistedmatrix.com/trac/ticket/816</a>&gt;, somebody please fix it :).)</div><div><br></div><div>-glyph</div><div><br></div><br></body></html>