On Mon, Aug 10, 2009 at 5:03 PM, dave fowler <span dir="ltr"><<a href="mailto:davefowler@gmail.com">davefowler@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Glyph, thanks for the great feedback. I'm looking into all of this now. <div><br></div><div>I don't think it's a ulimit issue as it seems to be "unlimited"</div><div><br></div><div><div>root@Proxy1:~# ulimit</div>
<div>unlimited</div><div></div></div></blockquote><div><br>This is a lie that your shell tells you. Here it is on my computer:<br><br><div style="margin-left: 40px;">glyph@nhuvasarim:~$ ulimit <br>unlimited<br>glyph@nhuvasarim:~$ ulimit -a<br>
core file size (blocks, -c) 0<br>data seg size (kbytes, -d) unlimited<br>scheduling priority (-e) 0<br>file size (blocks, -f) unlimited<br>pending signals (-i) 16135<br>
max locked memory (kbytes, -l) 32<br>max memory size (kbytes, -m) unlimited<br>open files (-n) 1024<br>pipe size (512 bytes, -p) 8<br>POSIX message queues (bytes, -q) 819200<br>
real-time priority (-r) 0<br>stack size (kbytes, -s) 8192<br>cpu time (seconds, -t) unlimited<br>max user processes (-u) 16135<br>virtual memory (kbytes, -v) unlimited<br>
file locks (-x) unlimited<br></div><br>as you can see, many of those values (specifically, in your case, "open files") do actually have limits. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><br></div><div>I think my first step will be to just make a log observer that will simply restart the proxy script when it sees (EMFILE) so that I don't have to keep logging in at night to restart it myself :).</div>
<div></div></div></blockquote><div><br>That does sound like a practical measure to take :).<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div>Thanks for filing that ticket. It would be great if there were a way to be notified of the particular error inside the code. </div></div></blockquote><div><br>No problem; I thought it was already filed.<br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>I like your suggestion of keeping a list of my open connections. I could also keep a time stamp with them and close down the oldest, or any that are over a certain time period.</div>
<div></div></div></blockquote><div><br>That's what I was thinking; or, maybe something more elaborate, like associating connections with accounts, and kicking off the most active connection associated with a non-administrator account, or the one which has been idle the longest... it depends on your application and desired security model.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div>I'm new to twisted. Do you know in what object of the Proxy the new connections are made and how to access them to store in a list? </div>
</div></blockquote><div><br>The protocol factory is where you'd want to do this. This FAQ deals with the main question, I think: <br><br><<a href="http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeinputononeconnectionresultinoutputonanother">http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeinputononeconnectionresultinoutputonanother</a>><br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Thanks again!</div></div></blockquote><div><br>No problem! <br>
</div></div><br>