V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Mei99  ›  全部回复第 1 页 / 共 1 页
回复总数  7
2019-09-02 19:05:01 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
nginx.conf:
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
#multi_accept on;

}

http {
upstream tomcat{
server 192.168.50.166:8080;
server 192.168.50.99:8080;
keepalive 20480;
}
server{
listen 8080;

location / {
proxy_pass http://tomcat;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
server_tokens off;
client_header_buffer_size 4k;
client_max_body_size 10m;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
2019-09-02 16:39:05 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@zpfhbyx 6 核的 i5 8500,6 个 worker 进程
2019-09-02 16:30:05 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@akira 只转到一边也不会比直接压测 Tomcat 性能还低吧....
2019-09-02 16:29:40 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@zjlletian 线程和连接数一般多少合适?我改成和 ulimit 一样的 65535 了
2019-09-02 16:14:39 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@opengps 带宽应该没啥问题,内网千兆互联,看 Jmeter 最大发送速度才 2.5MB/s,Nginx 机器的 CPU 也没有跑满,压测机是 i9 9900K
2019-09-02 15:56:54 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@BBCCBB 我挂 Nginx 就是为了给后面多个 Tomcat 做负载均衡啊....性能反而还下降了
2019-09-02 15:56:13 +08:00
回复了 Mei99 创建的主题 NGINX 为什么用 Nginx 做了负载均衡之后 QPS 还不如直接压测 Tomcat?
@opengps 可是 Nginx 不是说轻松达到几万 QPS 吗?那压测 Nginx 的话不应该是接近 Tomcat 的 QPS*2 吗?
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   962 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:42 · PVG 04:42 · LAX 13:42 · JFK 16:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.