티스토리 뷰
본 포스팅은 WebtoB Server의 로드밸런싱 방식인 RR/FA 동작 방식에 대해 알아보겠습니다.
Schedule 옵션 설명
(1) RR : Round Robin방식으로, Idle한 서버 프로세스에 요청을 할당합니다.
(2) FA : First Assign방식으로 우선순위(index)가 높고 Idle한 서버 프로세스에 요청을 할당합니다.
(spr_no가 할당되는 시점은 JEUS의 각 thread로부터 (tcp)connection이 맺어졌을 때 할당됨.)
그리고 등록시 jengineno라는 것을 부여 받게 됩니다.
Ex) 3개의 container가 webtob server에 연결
infrasvr_servlet_engine1 -> jengineno=0
infrasvr_servlet_engine3 -> jengineno=1
infrasvr_servlet_engine2 -> jengineno=2
- WEBTOB SYS LOG 확인 -
[2014/07/31:15:06:10] HTL-19967 I HTL0021: Successfully registered HTH. Start listening for this HTH. index=0, fd=5
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=33, tid=3, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=38, tid=8, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=37, tid=7, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=31, tid=1, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=35, tid=5, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=36, tid=6, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=39, tid=9, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=34, tid=4, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=32, tid=2, jengineno=0, jengineid=infrasvr_servlet_engine1, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=50, tid=0, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=57, tid=7, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=58, tid=8, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=59, tid=9, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=51, tid=1, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=52, tid=2, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=56, tid=6, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=53, tid=3, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=54, tid=4, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=44, tid=4, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=46, tid=6, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=49, tid=9, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=42, tid=2, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=40, tid=0, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=48, tid=8, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=43, tid=3, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=41, tid=1, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=47, tid=7, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=45, tid=5, jengineno=2, jengineid=infrasvr_servlet_engine2, remote ip=127.0.0.1
[2014/07/31:15:06:13] HTH-19968 I HTH0289: JSV server registered. svr=testGroup, svri=1, spri=55, tid=5, jengineno=1, jengineid=infrasvr_servlet_engine3, remote ip=127.0.0.1
RR이고, 위와 같이 register된 경우 jengineno를 기준으로 1->2 -> … 번호 -> 0 순서로 servlet engine을 선택하고 각 jengineno기준으로 먼저 register된 spri기준으로 스케쥴링. 위의 예에서는 요청이 들어오는 순서로 50 -> 44 -> 33 -> 57 -> 46 -> 38 -> 58 -> 46 -> 38 순서로 스케쥴링 됩니다.
RR이고, 위와 같이 register된 경우 jengineno를 기준으로 1->2->3->0 순서로 servlet engine을 선택하고, 요청을 받아서 busy 한 경우 가 아니라면 반복 됨. 요청이 들어오는 순서로 50 -> 44 -> 33 -> 57 -> 44 -> 33 -> 50 -> 44 -> 33 순서로 스케쥴링 됩니다. 57이 들어가있는 내용은 기존에 spri 50 번이 active 상태인 경우에 스케쥴 하게 됨.
wsadmin > st -p 로 확인 가능 (CacheEntry = 0 설정 후 확인)
jengineno -> spr_no 라고 생각하며, 동일한 방식 scheudule로 처리 됨.
[infrasvr:/user/mkko/webtob/config]$ wsadmin
--- Welcome to WebtoB Admin (Type "quit" to leave) ---
$$1 infrasvr (wsadm) [2014/07/31:17:04:51]: si
--------------------------------------------------------------------------------
hth svrname (svri) status count cqcnt aqcnt qpcnt emcnt rscnt rbcnt
--------------------------------------------------------------------------------
0 html ( 0) RDY 20 0 0 0 0 0 0
0 testGroup ( 1) RDY 0 0 0 0 0 0 0
$$2 infrasvr (wsadm) [2014/07/31:17:04:52]: st -p html
HTH 0(25281): RDY
---------------------------------------------------------------------------
svr_name svgname spr_no(pid) status count avg(rt) clid svc
---------------------------------------------------------------------------
html htmlg 0( 25284) RDY 1 0.0003( 0) -1 -
html htmlg 1( 25283) RDY 1 0.0003( 0) -1 -
html htmlg 2( 25288) RDY 1 0.0004( 0) -1 -
html htmlg 3( 25282) RDY 1 0.0004( 0) -1 -
html htmlg 4( 25307) RDY 1 0.0003( 0) -1 -
html htmlg 5( 25298) RDY 1 0.0003( 0) -1 -
html htmlg 6( 25292) RDY 1 0.0003( 0) -1 -
html htmlg 7( 25285) RDY 1 0.0003( 0) -1 -
html htmlg 8( 25308) RDY 1 0.0003( 0) -1 -
html htmlg 9( 25300) RDY 1 0.0003( 0) -1 -
html htmlg 10( 25301) RDY 1 0.0003( 0) -1 -
html htmlg 11( 25309) RDY 1 0.0003( 0) -1 -
html htmlg 12( 25304) RDY 1 0.0003( 0) -1 -
html htmlg 13( 25303) RDY 1 0.0003( 0) -1 -
html htmlg 14( 25306) RDY 1 0.0003( 0) -1 -
html htmlg 15( 25302) RDY 1 0.0003( 0) -1 -
html htmlg 16( 25295) RDY 1 0.0003( 0) -1 -
html htmlg 17( 25291) RDY 1 0.0003( 0) -1 -
html htmlg 18( 25299) RDY 1 0.0003( 0) -1 -
html htmlg 19( 25296) RDY 1 0.0003( 0) -1 -
html htmlg 20( 25305) RDY 0 0.0000( 0) -1 -
html htmlg 21( 25290) RDY 0 0.0000( 0) -1 -
html htmlg 22( 25311) RDY 0 0.0000( 0) -1 -
html htmlg 23( 25310) RDY 0 0.0000( 0) -1 -
html htmlg 24( 25293) RDY 0 0.0000( 0) -1 -
html htmlg 25( 25297) RDY 0 0.0000( 0) -1 -
html htmlg 26( 25287) RDY 0 0.0000( 0) -1 -
html htmlg 27( 25294) RDY 0 0.0000( 0) -1 -
html htmlg 28( 25286) RDY 0 0.0000( 0) -1 -
html htmlg 29( 25289) RDY 0 0.0000( 0) -1 -
$$1 infrasvr (wsadm) [2014/07/31:17:02:43]: st -p html
HTH 0(20102): RDY
---------------------------------------------------------------------------
svr_name svgname spr_no(pid) status count avg(rt) clid svc
---------------------------------------------------------------------------
html htmlg 0( 20127) RDY 58 0.0002( 0) -1 -
html htmlg 1( 20109) RDY 0 0.0000( 0) -1 -
html htmlg 2( 20108) RDY 0 0.0000( 0) -1 -
html htmlg 3( 20121) RDY 0 0.0000( 0) -1 -
html htmlg 4( 20118) RDY 0 0.0000( 0) -1 -
html htmlg 5( 20110) RDY 0 0.0000( 0) -1 -
html htmlg 6( 20113) RDY 0 0.0000( 0) -1 -
html htmlg 7( 20119) RDY 0 0.0000( 0) -1 -
html htmlg 8( 20114) RDY 0 0.0000( 0) -1 -
html htmlg 9( 20115) RDY 0 0.0000( 0) -1 -
html htmlg 10( 20120) RDY 0 0.0000( 0) -1 -
html htmlg 11( 20117) RDY 0 0.0000( 0) -1 -
html htmlg 12( 20132) RDY 0 0.0000( 0) -1 -
html htmlg 13( 20112) RDY 0 0.0000( 0) -1 –
. . . 생략 . . .
FA나, RR인 경우 처리 시간의 차이나 부하가 발생하는 내용수준은 아님. 다만 내부 code여서 trace로그로 남기더라도 log로 해당 logic이 처리되는 내용을 볼 수는 없지만 전체적인 처리 내용에 대한 로그를 확인 했을 때 처리시간의 차이는 없음으로 해당 logic 이 수행되는데 큰 부하는 없음을 알 수 있음.
######### RR 인 경우 schedule= 가 0입니다 ########
[2014/07/31:14:37:32] HTH-17893 T tmax_msg.c:40 0: spr_schedule(0, 0xe4a278): svri=1, svrtype=16, schedule=0, starti=30, endi=89
[2014/07/31:14:37:32] HTH-17893 T tmax_msg.c:54 0: spr_schedule: clii=0, jengineno=-1
[2014/07/31:14:37:32] HTH-17893 T tmax_msg.c:199 0: spr_schedule--4: spri=38, grp_sprp=0xe82f50, sched_index=0
[2014/07/31:14:37:32] HTH-17893 T http_msg.c:526 0: http_request_msg--3: spr_schedule(clii=0, svri=1)=38
[2014/07/31:14:37:32] HTH-17893 T tmax_msg.c:376 0: make_spr_running: jsv server(1:38) qcount: 0(1)
[2014/07/31:14:37:32] HTH-17893 T http_jsv.c:275 0: transform_to_jsv_format: clii=0, msgtype=301
[2014/07/31:14:37:32] HTH-17893 T http_jsv.c:502 0: old jsv format: len=773, clen=0
FA 인 경우
######### FA 인 경우 schedule= 가 1입니다 ########
[2014/07/31:15:08:42] HTH-19968 T tmax_msg.c:40 0: spr_schedule(1, 0x1e59278): svri=1, svrtype=16, schedule=1, starti=30, endi=89
[2014/07/31:15:08:42] HTH-19968 T tmax_msg.c:54 0: spr_schedule: clii=1, jengineno=-1
[2014/07/31:15:08:42] HTH-19968 T tmax_msg.c:199 0: spr_schedule--4: spri=50, grp_sprp=0x1e91db0, sched_index=0
[2014/07/31:15:08:42] HTH-19968 T http_msg.c:526 0: http_request_msg--3: spr_schedule(clii=1, svri=1)=50
[2014/07/31:15:08:42] HTH-19968 T tmax_msg.c:376 0: make_spr_running: jsv server(1:50) qcount: 0(1)
[2014/07/31:15:08:42] HTH-19968 T http_jsv.c:275 0: transform_to_jsv_format: clii=1, msgtype=301
[2014/07/31:15:08:42] HTH-19968 T http_jsv.c:502 0: old jsv format: len=927, clen=0
######### RR 인 경우 schedule= 가 0입니다 ########
[2014/07/31:16:48:37] HTH-19174 T main.c:2163 0: msg from client: ind=0, msgtype=301, svcname=uri1, len=706
[2014/07/31:16:48:37] HTH-19174 T http_msg.c:249 0: http_request_msg--2: clii=0, svri=0, status=1, svgno=0
[2014/07/31:16:48:37] HTH-19174 T tmax_msg.c:40 0: spr_schedule(0, 0x1666210): svri=0, svrtype=1, schedule=0, starti=0, endi=29
[2014/07/31:16:48:37] HTH-19174 T tmax_msg.c:54 0: spr_schedule: clii=0, jengineno=-1
[2014/07/31:16:48:37] HTH-19174 T tmax_msg.c:231 0: spr_schedule--6: spri=17
[2014/07/31:16:48:37] HTH-19174 T http_msg.c:526 0: http_request_msg--3: spr_schedule(clii=0, svri=0)=17
[2014/07/31:16:48:37] HTH-19174 T tmax_msg.c:445 0: make_spr_running: cind[0], clid[0], seqno[105906178], svci.flags[0x0]
[2014/07/31:16:48:37] HTH-19174 T stat.c:28 0: update_spr_start: spri=17, svci=385, start_spri=0
[2014/07/31:16:48:37] HTH-19174 T main.c:1854 0: reply_to_server(17): spr.{fd=24, svri=0, status=2, cindex=0, whp=0x16a1090, wlength=0}
[2014/07/31:16:48:37] HTH-19174 T main.c:1888 0: msg to server: msgtype=301, svcname=uri1, len=706
[2014/07/31:16:48:37] HTH-19174 T svrio.c:433 0: write_to_svr_async(0x7ff7ed2aabc0): spr[17].{svri = 0, status = 2, wlength = 0}
[2014/07/31:16:48:37] HTH-19174 T svrio.c:487 0: write_to_svr_async--1: write(24, 0x16a1090, 802)=802: errno=0
[2014/07/31:16:48:37] HTH-19174 T main.c:1895 0: reply_to_server--1: write_to_svr_async(0x7ff7ed2aabc0)=2: errno=0
######### FA 인 경우 schedule= 가 1입니다 ########
[2014/07/31:16:51:03] HTH-20102 T main.c:2163 0: msg from client: ind=0, msgtype=301, svcname=uri1, len=706
[2014/07/31:16:51:03] HTH-20102 T http_msg.c:249 0: http_request_msg--2: clii=0, svri=0, status=1, svgno=0
[2014/07/31:16:51:03] HTH-20102 T tmax_msg.c:40 0: spr_schedule(0, 0x1177210): svri=0, svrtype=1, schedule=1, starti=0, endi=29
[2014/07/31:16:51:03] HTH-20102 T tmax_msg.c:54 0: spr_schedule: clii=0, jengineno=-1
[2014/07/31:16:51:03] HTH-20102 T tmax_msg.c:231 0: spr_schedule--6: spri=0
[2014/07/31:16:51:03] HTH-20102 T http_msg.c:526 0: http_request_msg--3: spr_schedule(clii=0, svri=0)=0
[2014/07/31:16:51:03] HTH-20102 T tmax_msg.c:445 0: make_spr_running: cind[0], clid[0], seqno[910950402], svci.flags[0x0]
[2014/07/31:16:51:03] HTH-20102 T stat.c:28 0: update_spr_start: spri=0, svci=385, start_spri=0
[2014/07/31:16:51:03] HTH-20102 T main.c:1854 0: reply_to_server(0): spr.{fd=6, svri=0, status=2, cindex=0, whp=0x11b2090, wlength=0}
[2014/07/31:16:51:03] HTH-20102 T main.c:1888 0: msg to server: msgtype=301, svcname=uri1, len=706
[2014/07/31:16:51:03] HTH-20102 T svrio.c:433 0: write_to_svr_async(0x7fd0c623d010): spr[0].{svri = 0, status = 2, wlength = 0}
[2014/07/31:16:51:03] HTH-20102 T svrio.c:487 0: write_to_svr_async--1: write(6, 0x11b2090, 802)=802: errno=0
[2014/07/31:16:51:03] HTH-20102 T main.c:1895 0: reply_to_server--1: write_to_svr_async(0x7fd0c623d010)=2: errno=0
WebtoB의 기본 로드밸런싱 방식인 RR의 동작방식을 살펴보았으며, FA라는 새로운 방식도 살펴보았습니다.
물론 설정의 가중을 선택하는 건 운영자의 몫이 될거 같습니다.
고맙습니다.
'④ 미들웨어 > ⓦ WebtoB' 카테고리의 다른 글
[WebtoB] URLRewrite 설정 가이드 (1) | 2018.07.11 |
---|---|
[WebtoB] Caching Test (0) | 2018.07.06 |
[WebtoB] ReverseProxy 로그밸런싱 처리 방법 (0) | 2018.07.04 |
[Web Server] SSL 설정 가이드 (0) | 2018.06.29 |
[Web Server] WEBTOB 사용 포트 가이드 (0) | 2018.06.07 |
- Total
- Today
- Yesterday
- git
- TA
- k8s
- Docker
- OpenStack
- SA
- jeus
- openstack token issue
- aa
- API Gateway
- 아키텍처
- apache
- 마이크로서비스
- MSA
- openstack tenant
- 오픈스택
- wildfly
- 쿠버네티스
- 마이크로서비스 아키텍처
- node.js
- aws
- JEUS7
- Architecture
- nodejs
- SWA
- kubernetes
- Da
- webtob
- JEUS6
- JBoss
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |