Browse Source

added uwsgi for python with gevent loop engine

Damjan Georgievski 12 years ago
parent
commit
3e878ecec5
6 changed files with 66 additions and 0 deletions
  1. 19 0
      uwsgi/README.md
  2. 0 0
      uwsgi/__init__.py
  3. 11 0
      uwsgi/benchmark_config
  4. 14 0
      uwsgi/hello.py
  5. 5 0
      uwsgi/requirements.txt
  6. 17 0
      uwsgi/setup.py

+ 19 - 0
uwsgi/README.md

@@ -0,0 +1,19 @@
+# WSGI Benchmarking Test
+
+This is the WSGI portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+### JSON Encoding Test
+
+
+* [JSON test controller/view](hello.py)
+
+## Infrastructure Software Versions
+The tests were run with:
+* [Python 2.7.3](http://www.python.org/)
+* [uwsgi 1.9.14](https://uwsgi-docs.readthedocs.org/)
+
+
+## Test URLs
+### JSON Encoding Test
+
+http://localhost:8080/json

+ 0 - 0
uwsgi/__init__.py


+ 11 - 0
uwsgi/benchmark_config

@@ -0,0 +1,11 @@
+{
+  "framework": "uwsgi",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "port": 8080,
+      "sort": 29
+    }
+  }]
+}

+ 14 - 0
uwsgi/hello.py

@@ -0,0 +1,14 @@
+import ujson
+
+
+def application(environ, start_response):
+    response = {
+      "message": "Hello, World!"
+    }
+    data = ujson.dumps(response)
+    response_headers = [
+        ('Content-type', 'text/plain'),
+        ('Content-Length', str(len(data)))
+    ]
+    start_response('200 OK', response_headers)
+    return [data]

+ 5 - 0
uwsgi/requirements.txt

@@ -0,0 +1,5 @@
+greenlet
+cython
+-e git://github.com/surfly/gevent.git#egg=gevent
+uwsgi
+ujson

+ 17 - 0
uwsgi/setup.py

@@ -0,0 +1,17 @@
+
+import subprocess
+import sys
+import setup_util
+
+
+def start(args):
+  subprocess.Popen('uwsgi --gevent 1000 --http :8080 -w hello --pidfile /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+  return 0
+
+
+def stop():
+      try:
+        subprocess.Popen('uwsgi --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+      except OSError:
+        pass
+  return 0