2 ms·
Innocently daft question coming up: As I understand, you can run web.py apps behind lighttpd, and the web server handles the processes. E.g. in lighttpd.cfg y
by adnam 17y ago
Innocently daft question coming up:
As I understand, you can run web.py apps behind lighttpd, and the web server handles the processes. E.g. in lighttpd.cfg you can set {"max-procs" => 4} and I would see 4 instances of my web.py script running. But how is this done for a web-server done 100% in python? Python uses a GIL that only allows one thread to interpret bytecode at a time, so despite the amazing performance of Twisted and Tornado, wouldn't we see this seriously degrade when the server had to anything more than 'hello world'? My worry is having a Twisted/Tornado app and only using 1/4th of my availble processing power: am I wrong to do so?
- joshu 17y agoThat applies to threading. Twisted and Tornado are epoll/kqueue/etc-based and do not use threads. Here's a good article on the differences between strategies: http://www.kegel.com/c10k.html http://www.kegel.com/c10k.html
- adnam 17y agoGreat article, thankyou!
- frognibble 17y agoSee http://www.tornadoweb.org/documentation#running-tornado-in-production http://www.tornadoweb.org/documentation#running-tornado-in-p... . FriendFeed uses nginx as a reverse proxy to run several instances of the Tornado web server process. Each process has its own GIL.
- adnam 17y agoThanks, I'll give it a go with lighttpd too.