2013-03-21 57 views
0

我使用的是Ubuntu 12,nginx,uwsgi 1.9和socket,django 1.5。uwsgi long timeouts

配置:從Windows7的

[uwsgi] 
base_path = /home/someuser/web/ 
module = server.manage_uwsgi 
uid = www-data 
gid = www-data 
virtualenv = /home/someuser 
master = true 
vacuum = true 
harakiri = 20 
harakiri-verbose = true 
log-x-forwarded-for = true 
profiler = true 
no-orphans = true 
max-requests = 10000 
cpu-affinity = 1 
workers = 4 
reload-on-as = 512 
listen = 3000 

客戶端測試:

C:\Users\user>C:\AppServ\Apache2.2\bin\ab.exe -c 255 -n 5000 http://www.someweb.com/about/ 
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 
Copyright 2006 The Apache Software Foundation, http://www.apache.org/ 

Benchmarking www.someweb.com (be patient) 
Completed 500 requests 
Completed 1000 requests 
Completed 1500 requests 
Completed 2000 requests 
Completed 2500 requests 
Completed 3000 requests 
Completed 3500 requests 
Completed 4000 requests 
Completed 4500 requests 
Finished 5000 requests 


Server Software:  nginx 
Server Hostname:  www.someweb.com 
Server Port:   80 

Document Path:   /about/ 
Document Length:  1881 bytes 

Concurrency Level:  255 
Time taken for tests: 66.669814 seconds 
Complete requests:  5000 
Failed requests:  1 
    (Connect: 1, Length: 0, Exceptions: 0) 
Write errors:   0 
Total transferred:  10285000 bytes 
HTML transferred:  9405000 bytes 
Requests per second: 75.00 [#/sec] (mean) 
Time per request:  3400.161 [ms] (mean) 
Time per request:  13.334 [ms] (mean, across all concurrent requests) 
Transfer rate:   150.64 [Kbytes/sec] received 

Connection Times (ms) 
       min mean[+/-sd] median max 
Connect:  0 8 207.8  1 9007 
Processing: 10 3380 11480.5 440 54421 
Waiting:  6 1060 3396.5 271 48424 
Total:   11 3389 11498.5 441 54423 

Percentage of the requests served within a certain time (ms) 
    50% 441 
    66% 466 
    75% 499 
    80% 519 
    90% 3415 
    95% 36440 
    98% 54407 
    99% 54413 
100% 54423 (longest request) 

我已經設置下列選項太多:

​​

所以,

1)我做第一3000個請求每個快速。我在ab和uwsgi請求日誌中看到進度 -

[pid: 5056|app: 0|req: 518/4997] 80.114.157.139() {30 vars in 378 bytes} [Thu Mar 21 12:37:31 2013] GET /about/ => generated 1881 bytes in 4 msecs (HTTP/1.0 200) 3 headers in 105 bytes (1 switches on core 0) 
[pid: 5052|app: 0|req: 512/4998] 80.114.157.139() {30 vars in 378 bytes} [Thu Mar 21 12:37:31 2013] GET /about/ => generated 1881 bytes in 4 msecs (HTTP/1.0 200) 3 headers in 105 bytes (1 switches on core 0) 
[pid: 5054|app: 0|req: 353/4999] 80.114.157.139() {30 vars in 378 bytes} [Thu Mar 21 12:37:31 2013] GET /about/ => generated 1881 bytes in 4 msecs (HTTP/1.0 200) 3 headers in 105 bytes (1 switches on core 0) 

我沒有任何損壞的管道或工人重生。

2)接着請求運行速度非常慢或一些超時。看起來像一些緩衝區變滿了,我等待它變空之前。

3)有些緩衝器變空。

4)〜500請求進行處理超快速。

5)有些超時。 6)參見Nr。 4

7)參見Nr。 5

8)參見Nr。 4

9)看到NR。 5

....

....

需要你的幫助

回答

0

用netstat和dmesg的。您可能已經用盡了臨時端口或填滿了conntrack表。