参照openrest.org的官方源码配置了nginx.conf,现在发现测试test接口时,100用户并发10min,也只有75%的成功率。还望大家指点下。另外,难道真得是服务器本身的问题,这个我也不好向同事提出来。谢谢!
cat nginx.conf
#user nobody;
worker_processes auto;
worker_cpu_affinity auto;
daemon on;
master_process on;
error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
# worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 9192;
server_name localhost;
charset utf-8;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /test {
default_type application/json;
content_by_lua_block {
ngx.say("helloworld")
}
}