2016-06-16 2 views
0

우리는 F5로드 밸런서를 우리의 서비스에 도입하려고 노력하고 있으며이를 위해 범용 지속성 기능과 세션을 지속하는 iRule을 개발 중입니다.
하지만 iRule 명령 "persist uie"로 세션을 유지하려고 할 때 대기 시간이 발생합니다.
지연 시간이 1000ms를 초과 할 수 있습니다 ...
무엇이 문제입니까? 어떻게이 대기 시간을 없앨 수 있을까요 ??F5 iRule for UIE - 지속성 Uie 명령 사용시 대기 시간

iRule 코드와 기록 된 로그를 참조하십시오. 여기

when HTTP_REQUEST { 
       if {[HTTP::host] equals "mpi-lb.creditguard.co.il" } { 
           set txID1 "" 
           set txID2 "" 
           set txID3 "" 
           set txID4 "" 
           set txID5 "" 
           set txID6 "" 
           set txID7 "" 
           set txID8 "" 
           # Log details for the request 
           regexp {(txId|token|mpiTransactionId|transactionID)[=>]([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})([&< ]|$)} [HTTP::uri] => txID1 txID2 txID3 txID4 
           regexp {(txId|token|mpiTransactionId|transactionID)[=>]([0-9a-z]{8}-([0-9a-z]{4}-){3}[0-9a-z]{12})([&< ]|$)} [HTTP::payload] => txID5 txID6 txID7 txID8 
           log local0. "uri:[HTTP::uri]:payload: txID2:$txID2 txID6:$txID6" 
           if {$txID2 != ""} { 
               log local0. "persist lookup uie:[persist lookup uie $txID2] $txID2 in uri" 
               persist uie $txID2 
           } elseif {$txID6 != ""} { 
               log local0. "persist lookup uie:[persist lookup uie $txID6] $txID6 in paylod" 
               persist uie $txID6 
           } 
       } 
} 

when HTTP_RESPONSE { 
       if {([IP::server_addr] equals "172.16.100.16") || ([IP::server_addr] equals "172.16.100.17") } { 
           # Trigger collection for up to 1MB of data 
           if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576} { 
               set content_length [HTTP::header "Content-Length"] 
           } else { 
               set content_length 1048576 
           } 
           # Check if $content_length is not set to 0 
           if { ([HTTP::status] == 200) && ($content_length > 0)} { 
               HTTP::collect $content_length 
           } 
       } 
} 

when HTTP_RESPONSE_DATA { 
       if {([IP::server_addr] equals "172.16.100.16") || ([IP::server_addr] equals "172.16.100.17") } { 
           # do stuff with the payload 
           #find the application unique identifier between <uid> and </uid> (5 is the length of <uid> string) 
           set txId [string trim [findstr [HTTP::payload] "<txId>" 5 "</txId>"] ">"] 
           if {$txId != ""} { 
               log local0. "[IP::server_addr] : persist add uie #$txId#" 
               persist add uie $txId 1800 
           } 
       } 
} 

가 로그입니다 (당신이 14시 16분 8초와 14시 17분 8초 사이의 대기 시간을 볼 수 있습니다)

Tue Jun 14 14:16:03 IDT 2016 info cgwaf tmm3[10326] Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/CreateTransactionExtended:payload: txID2: txID6: 
Tue Jun 14 14:16:04 IDT 2016 info cgwaf tmm3[10326]  Rule /Common/mpi-lb-irule <HTTP_RESPONSE_DATA>: 172.16.100.16 : persist add uie #03f72209-754e-4bde-85f6-69cdf4d27526# 
Tue Jun 14 14:16:08 IDT 2016 info cgwaf tmm1[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/PerformTransaction? txId=03f72209-754e-4bde-85f6-69cdf4d27526:payload: txID2:03f72209-754e-4bde-85f6-69cdf4d27526 txID6: 
Tue Jun 14 14:16:08 IDT 2016 info cgwaf tmm1[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: persist lookup uie:/Common/mpi-lb 172.16.100.16 443 03f72209-754e-4bde-85f6-69cdf4d27526 in uri 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm2[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/cvv.jpg:payload: txID2: txID6: 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm[10326] Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/mastercard_slice.gif:payload: txID2: txID6: 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/pci_slice.gif:payload: txID2: txID6: 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/visa_slice.gif:payload: txID2: txID6: 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/Logo.gif:payload: txID2: txID6: 
Tue Jun 14 14:17:08 IDT 2016 info cgwaf tmm3[10326] Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/merchantPages/ResponsiveWebSources/images/qm.png:payload: txID2: txID6: 
Tue Jun 14 14:18:06 IDT 2016 info cgwaf tmm2[10326] Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri://CGMPI_Server/ProcessCreditCard:payload: txID2: txID6:03f72209-754e-4bde-85f6-69cdf4d27526 
Tue Jun 14 14:18:06 IDT 2016 info cgwaf tmm2[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: persist lookup uie:/Common/mpi-lb 172.16.100.16 443 03f72209-754e-4bde-85f6-69cdf4d27526 in paylod 
Tue Jun 14 14:18:07 IDT 2016 info cgwaf tmm2[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri:/CGMPI_Server/merchantPages/nlb/OK.jsp?uniqueID=697536646.622257&lang=EN&authNumber=9125242& responseMac=7e77d7fe857e707ddf1c8990c80da8373f716c79d0ee79b88 f3d898a9ff0afc0&cardToken=1051484189394580& cardExp=0217&personalId=88888888& cardMask=458045******4580& txId=03f72209-754e-4bde-85f6-69cdf4d27526& numberOfPayments=&firstPayment=&periodicalPayment=:payload: txID2:03f72209-754e-4bde-85f6-69cdf4d27526 txID6: 
Tue Jun 14 14:18:07 IDT 2016 info cgwaf tmm2[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: persist lookup uie:/Common/mpi-lb 172.16.100.16 443 03f72209-754e-4bde-85f6-69cdf4d27526 in uri 
Tue Jun 14 14:18:07 IDT 2016 info cgwaf tmm2[10326]  Rule /Common/mpi-lb-irule <HTTP_REQUEST>: uri:/CGMPI_Server/merchantPages/WebSources/images/ssl.png:payload: txID2: txID6: 
: 여기

사전

에서
덕분에 우리 아이 룰 코드

답변

0

인바운드 및 아웃 바운드 플로우에서 정규 표현식 조회를 사용하는 것은 매우 비싸고 시간이 많이 소요됩니다. F5는 데이터를 프록시 처리하고, 유지하고, 흐름을 추출하고, 정규식 조작을 수행 한 다음 다시 출구 스택으로 전달해야 함을 명심하십시오. 시간을 최적화하려면 데이터 흐름을 유지하는 다른 방법을 찾아보십시오. https://devcentral.f5.com/wiki/iRules.timing.ashx

이하여 사용자가 GUI 내에서 통계를 받아야 실행 TMSH 버전에 따라, 또는 :

당신이 아이 룰이 사용하는 얼마나 많은 각 이벤트 처리 사이클을 볼 수있는 타이밍 명령을 사용할 수 있습니다, 말했다 TMSH 명령.

+0

빠른 답변을 주신 @kruczkowski에게 감사 드리며 타이밍 명령을 사용하겠습니다. 또한 우리는 정규 표현식을 알고 있으며 "txId"를 헤더로 옮길 계획입니다. 하지만 내가 잘못 생각하지 않는다면 regexp 명령이 완료된 후 레이턴시가 발생하고 "persist uie"명령을 실행할 때 레이턴시가 더 정확하게 보입니다. 이게 말이 돼...? –