python - uwsgi is hanging under high pressure -


i trying uwsgi:

to so, created python virtual envionment , installed uwsgi in it.

i created foobar.py sample file documentation :

def application(env, start_response):     start_response('200 ok', [('content-type','text/html')])     return [b"hello world"] 

and started uwsgi proposed in documentation :

uwsgi --http :9090 --wsgi-file foobar.py --master --processes 4 --threads 2 --logto /tmp/uwsgi.log 

then used 'ab' make small benchmark, after 7000 requests, bench hung, no reason (no message in logs) :

$ ab -n 10000 -c 100 http://127.0.0.1:9090/ apachebench, version 2.3 <$revision: 655654 $> copyright 1996 adam twiss, zeus technology ltd, http://www.zeustech.net/ licensed apache software foundation, http://www.apache.org/  benchmarking 127.0.0.1 (be patient) completed 1000 requests completed 2000 requests completed 3000 requests completed 4000 requests completed 5000 requests completed 6000 requests completed 7000 requests ^c      <-----------------------needed break bench here.  server software: server hostname:        127.0.0.1 server port:            9090  document path:          / document length:        11 bytes  concurrency level:      100 time taken tests:   18.275 seconds complete requests:      7208 failed requests:        0 write errors:           0 total transferred:      396440 bytes html transferred:       79288 bytes requests per second:    394.41 [#/sec] (mean) time per request:       253.544 [ms] (mean) time per request:       2.535 [ms] (mean, across concurrent requests) transfer rate:          21.18 [kbytes/sec] received  connection times (ms)               min  mean[+/-sd] median   max connect:        0    3   0.5      3       6 processing:     0    8   1.3      8      13 waiting:        0    8   1.4      8      13 total:          0   11   1.7     10      16  percentage of requests served within time (ms)   50%     10   66%     11   75%     12   80%     13   90%     13   95%     14   98%     15   99%     15  100%     16 (longest request) 

if redo test, 3000 requests pass before hang. tried less concurrency (10 or 1) still happen. experienced behaviour on os/x 10.8 , ubuntu 12.04. have same kind of behaviour gunicorn, works charm apache/mod_wsgi.

could tell me how not uwsgi hung on high pressure ?


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -