Wednesday, October 25, 2017

JMeter ile Dağıtık Yük Testi Çalıştırmak

jMeter ile web uygulamalarının yük testini dağıtık olarak gerçekleştirmek mümkündür. Bunun için öncelikle, jMeter testini koşturmak istediğiniz düğümlerde, jMeter'ı sunucu (jmeter-server) olarak çalıştırmalısınız. Örneğimizde, dört ayrı düğümde çalıştırmak yerine, aynı makinada dört jmeter-server prosesi çalıştıracağız. jmeter-server prosesinin belirli bir ağ adresini dinlemesi ve varsayılan port dışında bir portta çalışması için java.rmi.server.hostname ve server_port parametrelerinden yararlanıyoruz:

Düğüm #1


jmeter-server -Djava.rmi.server.hostname=172.17.1.10 -Dserver_port=4100
Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8832](local),objID:[-78bd43b9:15f531d5d0d:-7fff,-1004316542313261762]]]

Düğüm #2


jmeter-server -Djava.rmi.server.hostname=172.17.1.10 -Dserver_port=4200
Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8833](local),objID:[-7fb12730:15f532b1e7d:-7fff, -2674299161861049649]]]

Düğüm #3


jmeter-server -Djava.rmi.server.hostname=172.17.1.10 -Dserver_port=4300
Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8834](local),objID:[-14a765f7:15f532b3e5b:-7fff, 7046302240035060005]]]

Düğüm #4


jmeter-server -Djava.rmi.server.hostname=172.17.1.10 -Dserver_port=4400
Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8835](local),objID:[-467ada28:15f532b536b:-7fff, 4333599663267891393]]]

Ardından jmx testini aşağıdaki gibi dağıtık olarak çalıştırabiliriz:

jmeter -n -t google.jmx -R172.17.1.10:4100,172.17.1.10:4200,172.17.1.10:4300,172.17.1.10:4400
Creating summariser <summary>
Created the tree successfully using google.jmx
Configuring remote engine: 172.17.1.49:4100
Configuring remote engine: 172.17.1.49:4200
Configuring remote engine: 172.17.1.49:4300
Configuring remote engine: 172.17.1.49:4400
Starting remote engines
Starting the test @ Wed Oct 25 13:55:34 EET 2017 (1508928934095)
Remote engines have been started
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
Generate Summary Results +   2940 in 00:00:23 =  125.8/s Avg:   443 Min:     1 Max: 10820 Err:     0 (0.00%) Active: 118 Started: 108 Finished: 0
summary +   2942 in 00:00:23 =  127.4/s Avg:   443 Min:     1 Max: 10820 Err:     0 (0.00%) Active: 118 Started: 108 Finished: 0
Generate Summary Results +   9772 in 00:00:30 =  327.2/s Avg:   230 Min:     1 Max:  4093 Err:     0 (0.00%) Active: 169 Started: 169 Finished: 10
summary +   9770 in 00:00:30 =  328.4/s Avg:   230 Min:     1 Max:  4093 Err:     0 (0.00%) Active: 169 Started: 169 Finished: 10
summary =  12712 in 00:00:53 =  240.6/s Avg:   279 Min:     1 Max: 10820 Err:     0 (0.00%)
Generate Summary Results =  12712 in 00:00:53 =  238.8/s Avg:   280 Min:     1 Max: 10820 Err:     0 (0.00%)
Generate Summary Results +  11338 in 00:00:30 =  378.0/s Avg:   395 Min:     1 Max: 44910 Err:  3190 (28.14%) Active: 100 Started: 190 Finished: 100
Generate Summary Results =  24050 in 00:01:23 =  289.0/s Avg:   334 Min:     1 Max: 44910 Err:  3190 (13.26%)
summary +  11338 in 00:00:30 =  378.1/s Avg:   396 Min:     1 Max: 44910 Err:  3190 (28.14%) Active: 100 Started: 190 Finished: 100
summary =  24050 in 00:01:23 =  290.4/s Avg:   334 Min:     1 Max: 44910 Err:  3190 (13.26%)
summary +   5950 in 00:00:19 =  308.0/s Avg:   237 Min:     1 Max:  3149 Err:  2004 (33.68%) Active: 0 Started: 190 Finished: 200
summary =  30000 in 00:01:42 =  293.7/s Avg:   315 Min:     1 Max: 44910 Err:  5194 (17.31%)
Generate Summary Results +   5950 in 00:00:19 =  307.8/s Avg:   237 Min:     1 Max:  3149 Err:  2004 (33.68%) Active: 0 Started: 190 Finished: 200
Generate Summary Results =  30000 in 00:01:43 =  292.5/s Avg:   315 Min:     1 Max: 44910 Err:  5194 (17.31%)
Tidying up remote @ Wed Oct 25 13:57:19 EET 2017 (1508929039353)
... end of run

Düğümlerde, test isteğinin alındığını, testin başlatıldığını ve sonlandığını konsol logundan izleyebilirsiniz:

Düğüm #1

Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8939](local),objID:[4b4db1f4:15f532af954:-7fff, -616991648860323928]]]
Starting the test on host 172.17.1.10:4100 @ Wed Oct 25 13:55:41 EET 2017 (1508928941579)
Finished the test on host 172.17.1.10:4100 @ Wed Oct 25 13:57:19 EET 2017 (1508929039355)

Düğüm #2

Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8940](local),objID:[-7fb12730:15f532b1e7d:-7fff, -2674299161861049649]]]
Starting the test on host 172.17.1.10:4200 @ Wed Oct 25 13:55:36 EET 2017 (1508928936705)
Finished the test on host 172.17.1.10:4200 @ Wed Oct 25 13:56:47 EET 2017 (1508929007679)

Düğüm #3

Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8941](local),objID:[-14a765f7:15f532b3e5b:-7fff, 7046302240035060005]]]
Starting the test on host 172.17.1.10:4300 @ Wed Oct 25 13:55:38 EET 2017 (1508928938426)
Finished the test on host 172.17.1.10:4300 @ Wed Oct 25 13:57:13 EET 2017 (1508929033828)

Düğüm #4

Found ApacheJMeter_core.jar
Created remote object: UnicastServerRef [liveRef: [endpoint:[172.17.1.49:8942](local),objID:[-467ada28:15f532b536b:-7fff, 4333599663267891393]]]
Starting the test on host 172.17.1.10:4400 @ Wed Oct 25 13:55:35 EET 2017 (1508928935776)
Finished the test on host 172.17.1.10:4400 @ Wed Oct 25 13:56:41 EET 2017 (1508929001484)


No comments:

Post a Comment