设为首页 收藏本站
查看: 1312|回复: 0

[经验分享] memcached演练(4) 使用apache+memcached-session-manager+tomcat集群(续)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-8-15 10:54:07 | 显示全部楼层 |阅读模式
memcached演练(4) 使用apache+memcached-session-manager+tomcat集群,存在一些问题。问题列表
问题1:2个tomcat节点,apache,memcached服务器均放在一个虚拟机,不能真正模拟真实环境。
问题2:不能整整模拟分布式环境。
本文,重新设计下物理结构。沿用《memcached演练(4) 使用apache+memcached-session-manager+tomcat集群》配置。仅仅将主机进行了调整。
wKiom1eu4BOx0uY1AABh-HnKA04586.jpg

操作步骤。
1.将配置好的tomcat节点分别复制到 2个主机

1
2
scp -r apache-tomcat-node1 root@hadoop2:/u01
scp -r apache-tomcat-node2 root@hadoop3:/u01



2.修改apache的worker.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
[iyunv@hadoop1 /]# vi /etc/httpd/conf/workers.properties
worker.list=loadbalancer
worker.tomcat1.port=8009
worker.tomcat1.host=192.168.163.156
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat2.port=8019
worker.tomcat2.host=192.168.163.166
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=tomcat1,tomcat2
worker.loadbalancer.sticky_session=true



3.修改每个节点的tomcat的context相关MSM配置
1
2
3
   <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
      memcachedNodes="n1:192.168.163.146:11211" sticky="false"
      requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" />



指向192.168.163.146:11211

4.测试下吞吐量
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
c:\Apache24\bin>ab  -n 10000 -c 4  http://192.168.163.146/examples/testSession.jsp
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.163.146 (be patient)
Completed 1000 requests
...
Completed 10000 requests
Finished 10000 requests
Server Software:        Apache/2.2.15
Server Hostname:        192.168.163.146
Server Port:            80
Document Path:          /examples/testSession.jsp
Document Length:        331 bytes
Concurrency Level:      4
Time taken for tests:   10.322 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      5930000 bytes
HTML transferred:       3310000 bytes
Requests per second:    968.84 [#/sec] (mean)
Time per request:       4.129 [ms] (mean)
Time per request:       1.032 [ms] (mean, across all concurrent requests)
Transfer rate:          561.06 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      1       5
Processing:     0    4  11.7      3     585
Waiting:        0    4  11.7      3     585
Total:          0    4  11.7      3     585
ERROR: The median and mean for the initial connection time are more than twice the standard
       deviation apart. These results are NOT reliable.



吞吐量:968.84。比上节中的测试结果“727.55”超出不少。
经过多次测试,差别有点大。
Requests per second:    1281.74 [#/sec] (mean)

Requests per second:    1451.22 [#/sec] (mean)

模拟一台节点宕机情况,测试吞吐量
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
c:\Apache24\bin>ab  -n 10000 -c 4  http://192.168.163.146/examples/testSession.jsp
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.163.146 (be patient)
Completed 1000 requests
...
Finished 10000 requests


Server Software:        Apache/2.2.15
Server Hostname:        192.168.163.146
Server Port:            80

Document Path:          /examples/testSession.jsp
Document Length:        331 bytes

Concurrency Level:      4
Time taken for tests:   7.994 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      5930000 bytes
HTML transferred:       3310000 bytes
Requests per second:    1250.92 [#/sec] (mean)
Time per request:       3.198 [ms] (mean)
Time per request:       0.799 [ms] (mean, across all concurrent requests)
Transfer rate:          724.41 [Kbytes/sec] received



吞吐量:1250.92。FUCK出乎意料啊。竟然比2个节点的情况下还高。
多次测试,发现均在1700左右。

Requests per second:    1729.64 [#/sec] (mean)
Requests per second:    1779.67 [#/sec] (mean)。

结果出乎我的意料。 记住这个结果,以后做个监控分析下。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-258082-1-1.html 上篇帖子: memcached演练(4) 使用apache+memcached-session-manager+tomcat集群 下篇帖子: memcached演练(5) 内存管理
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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