51Testing软件测试论坛

标题: 为什么我loadrunner ip spoofer 的nginx iphash始终在使用同一服务在处理请求呢? [打印本页]

作者: qiyubin    时间: 2012-2-19 13:14
标题: 为什么我loadrunner ip spoofer 的nginx iphash始终在使用同一服务在处理请求呢?
附图跟 nginx 配置
  1. upstream mysvr {
  2.           #开启粘滞会话
  3.           ip_hash;
  4.       #weigth参数表示权值,权值越高被分配到的几率越大
  5.           server 172.16.17.120:8080;
  6.           server 172.16.17.120:10002;
  7.           server 172.16.17.89:8080;
  8.           #server 172.16.17.89:10002 weight=5;
  9.           #server 172.16.17.89:8080 weight=5;
  10.     }
  11.     server {               
  12.         listen 80;
  13.         server_name 172.16.17.120 localhost;
  14.                 charset utf-8;
  15.                 #对 "/" 启用负载均衡
  16.        location / {
  17.          proxy_pass http://mysvr/;
  18.          proxy_redirect off;
  19.          proxy_set_header Host $host;
  20.          proxy_set_header X-Real-IP $remote_addr;
  21.          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  22.          client_max_body_size    10m;
  23.          client_body_buffer_size 128k;
  24.          proxy_connect_timeout 90;
  25.          proxy_send_timeout      90;
  26.          proxy_read_timeout      90;
  27.          proxy_buffer_size      4k;
  28.          proxy_buffers          4 32k;
  29.          proxy_busy_buffers_size 64k;
  30.          proxy_temp_file_write_size 64k;
  31.                 }
  32.                 location /NginxStatus {
  33.                          stub_status on;
  34.                          access_log on;
  35.                          auth_basic "NginxStatus";
  36.                 }
  37.         }
复制代码
2012-02-19 12:57:23,199 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,217 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 17 ms (execution: 14 ms, result: 3 ms)
2012-02-19 12:57:23,243 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,258 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 14 ms (execution: 12 ms, result: 2 ms)
2012-02-19 12:57:23,286 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,303 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 16 ms (execution: 14 ms, result: 2 ms)
2012-02-19 12:57:23,349 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.89
2012-02-19 12:57:23,365 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 15 ms (execution: 13 ms, result: 2 ms)
?????? DaemonCollege time=2012-02-19 13:00:00
^C
root@ubuntu:~# tail -f /opt/tomcat/apache-tomcat-6.0.35/logs/catalina.out
2012-02-19 13:05:02,302 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/index!index!action!200] took 1 ms (execution: 0 ms, result: 1 ms)
2012-02-19 13:05:02,304 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 18 ms (execution: 17 ms, result: 1 ms)
2012-02-19 13:05:02,357 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,359 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,664 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,669 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 308 ms (execution: 8 ms, result: 300 ms)
2012-02-19 13:05:02,673 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/index!index!action!200] took 2 ms (execution: 1 ms, result: 1 ms)
2012-02-19 13:05:02,675 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 316 ms (execution: 11 ms, result: 305 ms)
2012-02-19 13:05:02,721 INFO [com.socialtv.system.LoginFilter] - check user is login!----request ip:172.16.17.240
2012-02-19 13:05:02,731 INFO [org.apache.struts2.rest.RestActionInvocation] - Executed action [//pub/tvhome!goTV!action!200] took 9 ms (execution: 7 ms, result: 2 ms)
[attach]77643[/attach]
作者: qiyubin    时间: 2012-2-19 13:15
我一共模拟了5个IP 结果全部都访问8080 tomcat服务 我在服务器上安装了2个tomcat服务
作者: qiyubin    时间: 2012-2-19 14:48
结贴!
漆羽斌:
      nginx负载均衡最小单位是C类网关 ,我模拟了2个比c类大的IP成功了。。。
作者: xueying1123    时间: 2012-9-17 18:25
楼主怎么设置的,我模拟了1个A类、1个B类、1个C类,三个ip地址对nginx的iphash负载均衡做压力,怎么压力还是全在同一个应用服务器上?
还能把楼主召唤出来不 - -
作者: xueying1123    时间: 2012-9-17 18:28
我模拟了三个Ip地址分别是A类B类C类,对nginx的iphash负载均衡做压力测试,为什么压力全在一台应用服务器上。
还能把楼主召唤出来不 - -
作者: xueying1123    时间: 2012-9-19 10:49
别人有解决办法吗
作者: xueying1123    时间: 2012-9-19 11:24
可以了




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2