class WSGIHTTPServer(socketserver.ThreadingMixIn, WSGIServer):
to:
class WSGIHTTPServer(socketserver.ForkingMixIn, WSGIServer):
and I noticed the requests were not getting faster after the first request, and sure enough, I tracked it down to Router's cache not populating, I think this is because python fork's and then creates the cache and then the master process never inherits the cache back from the forked process, so it has to rebuild the cache on ever request.
Because of this I've gone back to ThreadingMixIn but I might want to figure out if there is an acceptable permanent solution that works across forking and threading.
I switched the wsgi server from:
to:
and I noticed the requests were not getting faster after the first request, and sure enough, I tracked it down to Router's cache not populating, I think this is because python fork's and then creates the cache and then the master process never inherits the cache back from the forked process, so it has to rebuild the cache on ever request.
Because of this I've gone back to
ThreadingMixIn
but I might want to figure out if there is an acceptable permanent solution that works across forking and threading.