python으로 웹 서비스 만들어보기.
By SeukWon Kang
를 하기전에 ^^;;;
web server : apache , lighttpd, nginx , cherokee, cherrypy, simplehttpserver(python) web app protocol : static file, wsgi , uwsgi web app frame work : node, cherrypy, django , web2py, 중 어떤 조합을 사용할지를 결정해야 해서
그동안 써왔던 것을 모두 점검하는 의미로 간단/대충 벤치마크를 해봤음. 즉 이글은 그 기록을 남기기 위한 글. ^^
기본적으로 다 hello world 를 리턴하는 static file 또는 print 코드 를 사용 해서 테스트 했습니다. TPS 의 유효 수자는 2자리 정도 입니다.
Ab –c 100 –n 30 http://localhost/ Ab –c 100 –n 30 http://localhost/hello 형태 ( 앞은 파일, 뒤는 web app )
Core2duo 3G / ubuntu x64 입니다.
Node.js
7000 TPS
Cherrypy3
1000 TPS
Python –m SimpleHTTPServer
2600 TPS
Apache static (Apache/2.2.17)
11000 TPS
Apache cherrypy wsgi
1500 TPS
Apache 2.2.17 embedded mode_wsgi django 1.25
3260 TPS
Lighttpd static (lighttpd/1.4.28)
14000 TPS
Nginx static (nginx/0.8.54)
17000 TPB
nginx/1.0.4 static
17800 TPS
nginx/1.0.4 uwsgi
6561 TPS
nginx/1.0.4 uwsgi django 1.2.5
6972 TPS
nginx/1.0.4 uwsgi web2py
180 TPS
Cherokee static (Cherokee/1.2.98)
15000 TPS
Cherokee uwsgi
6500 TPS
Apache (Apache/2.2.17) + php5
7600 TPS
Apache embedded mod_wsgi no framework
7700 TPS
Apache daemon mod_wsgi no framework
4700 TPS
개인적으로는 nginx + uwsgi 가 가장 맘에 들었지만.
실제 프로젝트에 쓰기위해선 안정성,인지도,문서의 양, 문제검색시 답변 많음 등이 필요한 관계로 뭘 선택할지는 고민중..
그냥 개인 프로젝트를 할땐 nginx + uwsgi 를 쓸것 같다.