Permalink
Browse files

Added Python/flup

  • Loading branch information...
snoyberg committed Mar 14, 2011
1 parent 734aeff commit ac491153cfe797c6a34a4e2d4990d71052b407a8
Showing with 52 additions and 0 deletions.
  1. +25 −0 pong/python.nginx.conf
  2. +8 −0 pong/python.py
  3. +15 −0 pong/python.sh
  4. +4 −0 setup-python.sh
View
@@ -0,0 +1,25 @@
+daemon off;
+events {
+ worker_connections 4096;
+}
+
+http {
+ server {
+ listen 3000;
+ server_name _;
+
+ location / {
+ # host and port to fastcgi server
+ fastcgi_pass 127.0.0.1:9000;
+ fastcgi_param SERVER_NAME $server_name;
+ fastcgi_param SERVER_PORT $server_port;
+ fastcgi_param SERVER_PROTOCOL $server_protocol;
+ fastcgi_param PATH_INFO $fastcgi_script_name;
+ fastcgi_param REQUEST_METHOD $request_method;
+ fastcgi_param QUERY_STRING $query_string;
+ fastcgi_param CONTENT_TYPE $content_type;
+ fastcgi_param CONTENT_LENGTH $content_length;
+ }
+
+ }
+}
View
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+
+def myapp(environ, start_response):
+ start_response('200 OK', [('Content-Type', 'text/plain')])
+ return ['PONG']
+
+from flup.server.fcgi import WSGIServer
+WSGIServer(myapp).run()
View
@@ -0,0 +1,15 @@
+#!/bin/bash -x
+
+d=$(readlink -f $(dirname $0))
+
+spawn-fcgi -p 9000 -n -- $d/python.py &
+py=$!
+
+sleep 1
+
+/usr/local/nginx/sbin/nginx -c $d/python.nginx.conf &
+nx=$!
+
+httperf --hog --server=localhost --port=3000 --uri=/ --rate=1000 --num-conns=200 --num-calls=100 --burst-length=20
+kill $nx
+kill $py
View
@@ -0,0 +1,4 @@
+wget http://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz
+tar zxfv flup-1.0.2.tar.gz
+cd flup-1.0.2/
+python setup.py install

0 comments on commit ac49115

Please sign in to comment.