Эх сурвалжийг харах

Update wsgi

remove uWSGI test since uWSGI has separate test.
Use Python 3 insetead of 2.
INADA Naoki 9 жил өмнө
parent
commit
96b771219f

+ 1 - 20
frameworks/Python/wsgi/benchmark_config.json

@@ -16,26 +16,7 @@
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "wsgi-meinheld",
-      "notes": "",
-      "versus": "wsgi"
-    },
-    "nginx-uwsgi": {
-      "setup_file": "setup_nginxuwsgi",
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Stripped",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "wsgi",
-      "language": "Python",
-      "orm": "Raw",
-      "platform": "uWSGI",
-      "webserver": "nginx",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "wsgi-nginx-uWSGI",
+      "display_name": "meinheld",
       "notes": "",
       "versus": "wsgi"
     }

+ 2 - 2
frameworks/Python/wsgi/hello.py

@@ -15,7 +15,7 @@ def json(environ, start_response):
         ('Content-type', 'application/json'),
         ('Content-Length', str(len(data)))
     ]
-    start_response(b'200 OK', response_headers)
+    start_response('200 OK', response_headers)
     return [data]
 
 def plaintext(environ, start_response):
@@ -24,7 +24,7 @@ def plaintext(environ, start_response):
         ('Content-type', 'text/plain'),
         ('Content-Length', str(len(data)))
     ]
-    start_response(b'200 OK', response_headers)
+    start_response('200 OK', response_headers)
     return [data]
 
 def app(environ, start_response):

+ 0 - 48
frameworks/Python/wsgi/nginx.conf

@@ -1,48 +0,0 @@
-# This file is based on /usr/local/nginx/conf/nginx.conf.default.
-
-# One worker process per core
-error_log stderr error;
-
-events {
-    # This needed to be increased because the nginx error log said so.
-    # http://nginx.org/en/docs/ngx_core_module.html#worker_connections
-    worker_connections  65535;
-    multi_accept on;
-}
-
-http {
-    default_type  application/octet-stream;
-    client_body_temp_path      /tmp;
-
-    # turn off request logging for performance
-    access_log off;
-
-    # I think these only options affect static file serving
-    sendfile        on;
-    tcp_nopush      on;
-
-    # Allow many HTTP Keep-Alive requests in a single TCP connection before
-    # closing it (the default is 100). This will minimize the total number
-    # of TCP connections opened/closed. The problem is that this may cause
-    # some worker processes to be handling too connections relative to the
-    # other workers based on an initial imbalance, so this is disabled for
-    # now.
-#    keepalive_requests 1000;
-
-    #keepalive_timeout  0;
-    keepalive_timeout  65;
-
-    server {
-        # For information on deferred, see:
-        # http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
-        # http://www.techrepublic.com/article/take-advantage-of-tcp-ip-options-to-optimize-data-transmission/
-        # The backlog argument to listen() is set to match net.ipv4.tcp_max_syn_backlog and net.core.somaxconn
-        listen       8080 default_server deferred backlog=65535;
-        server_name  localhost;
-
-        location / {
-            uwsgi_pass unix:/tmp/uwsgi.sock;
-            include /usr/local/nginx/conf/uwsgi_params;
-        }
-    }    
-}

+ 4 - 6
frameworks/Python/wsgi/requirements.txt

@@ -1,6 +1,4 @@
-ujson==1.33
-uwsgi
-gunicorn==19.3.0
-meinheld==0.5.7
-
-greenlet==0.4.7
+ujson==1.35
+gunicorn==19.4.5
+meinheld==0.5.9
+greenlet==0.4.9

+ 2 - 2
frameworks/Python/wsgi/setup.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
-fw_depends python2
+fw_depends python3
 
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
+pip install --install-option="--prefix=${PY3_ROOT}" -r $TROOT/requirements.txt
 
 gunicorn hello:app -c gunicorn_conf.py &

+ 0 - 10
frameworks/Python/wsgi/setup_nginxuwsgi.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-
-fw_depends python2 nginx
-
-sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
-
-pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
-
-nginx -c $TROOT/nginx.conf
-uwsgi --ini uwsgi.ini --processes $MAX_THREADS --wsgi hello:app &

+ 0 - 19
frameworks/Python/wsgi/uwsgi.ini

@@ -1,19 +0,0 @@
-[uwsgi]
-master
-; Increase listen queue used for nginx connecting to uWSGI. This matches
-; net.ipv4.tcp_max_syn_backlog and net.core.somaxconn.
-listen = 65535
-; for performance
-disable-logging
-; use UNIX sockets instead of TCP loopback for performance
-socket = /tmp/uwsgi.sock
-; allow nginx to access the UNIX socket
-chmod-socket = 666
-; Avoid thundering herd problem http://uwsgi-docs.readthedocs.org/en/latest/articles/SerializingAccept.html .
-; This is currently disabled because when I tried it with flask, it caused a
-; 20% performance hit. The CPU cores could not be saturated with thunder-lock.
-; I'm not yet sure the full story, so this is presently disabled. Also,
-; disabling this caused bottle to get ~13% faster.
-;thunder-lock
-; used by uwsgi_stop.ini
-pidfile = /tmp/uwsgi.pid