51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4470|回复: 6
打印 上一主题 下一主题

[求助] 为什么我loadrunner ip spoofer 的nginx iphash始终在使用同一服务在处理请求呢?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2012-2-19 13:14:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
附图跟 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)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2012-2-19 13:15:42 | 只看该作者
我一共模拟了5个IP 结果全部都访问8080 tomcat服务 我在服务器上安装了2个tomcat服务
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2012-2-19 14:48:23 | 只看该作者
结贴!
漆羽斌:
      nginx负载均衡最小单位是C类网关 ,我模拟了2个比c类大的IP成功了。。。
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2012-9-17 18:25:23 | 只看该作者
楼主怎么设置的,我模拟了1个A类、1个B类、1个C类,三个ip地址对nginx的iphash负载均衡做压力,怎么压力还是全在同一个应用服务器上?
还能把楼主召唤出来不 - -
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2012-9-17 18:28:10 | 只看该作者
我模拟了三个Ip地址分别是A类B类C类,对nginx的iphash负载均衡做压力测试,为什么压力全在一台应用服务器上。
还能把楼主召唤出来不 - -
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2012-9-19 10:49:35 | 只看该作者
别人有解决办法吗
回复 支持 反对

使用道具 举报

该用户从未签到

7#
发表于 2012-9-19 11:24:57 | 只看该作者
可以了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-10-9 00:48 , Processed in 0.092865 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表