Message106117
Using the wsgiref simple HTTP server or any other capable of > 2000 requests/sec. demonstrates an issue with Macintosh sockets.
Mac OS X Version: 10.6.3 (Build 10D573)
Python Version: 2.6.1 (32-bit)
The minimal application needed to demonstrate the problem is:
import sys, cStringIO
from wsgiref.simple_server import make_server
sys.stderr = cStringIO.StringIO() # disable request logging
def app(environ, start_response):
start_response("200 OK", [('Content-Type', 'text/plain')])
return ['Hello world!\n']
httpd = make_server('', 8080, app)
httpd.serve_forever()
Then hammer the server using Apache Bench:
ab -n 20000 -c 5 http://127.0.0.1:8080/
At almost exactly the 16000 request mark socket connections begin to time out. Sockets are then freed up at the rate of about 40/second (on my box). Killing the ab run when it freezes then immediately re-trying (and cancelling after a few seconds) will show this rate. Time must pass for some connection 'pool' to free the connections before you can do another 16000 requests.
This problem does not appear on the following setup:
Operating System: Gentoo Linux
Python Version: 2.6.4 (32-bit) |
|
Date |
User |
Action |
Args |
2010-05-19 23:37:27 | amcgregor | set | recipients:
+ amcgregor |
2010-05-19 23:37:27 | amcgregor | set | messageid: <1274312247.36.0.878213869408.issue8771@psf.upfronthosting.co.za> |
2010-05-19 23:37:25 | amcgregor | link | issue8771 messages |
2010-05-19 23:37:24 | amcgregor | create | |
|