Bug 1938921

Summary: Router HAProxy config file template is slow to render due to repetitive regex compilations
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: NetworkingAssignee: Andrew McDermott <amcdermo>
Networking sub component: router QA Contact: Arvind iyengar <aiyengar>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aiyengar, aos-bugs, bperkins, mmasters
Version: 3.11.0   
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-05 13:56:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1937972    
Bug Blocks: 1938922    

Comment 2 Arvind iyengar 2021-03-25 10:57:43 UTC
Verified in "4.7.0-0.nightly-2021-03-24-213550" release version. With this payload, it is observed that the haproxy template rendition continuous to happen under sub-seconds times during constant load of generating 5k routes at a time. As noted below, the time hovered closed to 500ms consistently with no notable spikes beyond it: 
------
oc get clusterversion    
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.nightly-2021-03-24-213550   True        False         8h      Cluster version is 4.7.0-0.nightly-2021-03-24-213550

oc -n openshift-ingress logs  router-default-5bfcc867fc-lnrp7  -f | grep -i Writeconfig
I0325 08:27:10.314032       1 router.go:456] template "msg"="writeConfig"  "duration"="59.405014ms"
I0325 08:27:15.314489       1 router.go:456] template "msg"="writeConfig"  "duration"="59.782366ms"
I0325 08:27:20.313557       1 router.go:456] template "msg"="writeConfig"  "duration"="58.760965ms"
I0325 08:27:25.316040       1 router.go:456] template "msg"="writeConfig"  "duration"="61.145185ms"
I0325 08:27:30.314349       1 router.go:456] template "msg"="writeConfig"  "duration"="59.359811ms"
I0325 08:27:35.294904       1 router.go:456] template "msg"="writeConfig"  "duration"="39.820195ms"
I0325 08:27:40.318171       1 router.go:456] template "msg"="writeConfig"  "duration"="62.979913ms"
I0325 08:27:45.296150       1 router.go:456] template "msg"="writeConfig"  "duration"="40.852918ms"
 
I0325 10:20:37.898634       1 router.go:456] template "msg"="writeConfig"  "duration"="424.361488ms"
I0325 10:20:42.900593       1 router.go:456] template "msg"="writeConfig"  "duration"="426.368431ms"
I0325 10:20:47.905153       1 router.go:456] template "msg"="writeConfig"  "duration"="430.808979ms"
I0325 10:20:52.854680       1 router.go:456] template "msg"="writeConfig"  "duration"="380.227026ms"
I0325 10:20:57.925729       1 router.go:456] template "msg"="writeConfig"  "duration"="451.175934ms"
I0325 10:21:02.913331       1 router.go:456] template "msg"="writeConfig"  "duration"="438.707291ms"   
 
I0325 10:49:17.992727       1 router.go:456] template "msg"="writeConfig"  "duration"="479.737095ms"
I0325 10:49:23.022972       1 router.go:456] template "msg"="writeConfig"  "duration"="509.909029ms"
I0325 10:49:28.063640       1 router.go:456] template "msg"="writeConfig"  "duration"="550.487276ms"
I0325 10:49:33.031263       1 router.go:456] template "msg"="writeConfig"  "duration"="518.004707ms"
I0325 10:49:37.973882       1 router.go:456] template "msg"="writeConfig"  "duration"="460.525431ms"


oc get route | wc -l               
5003
------

Comment 5 errata-xmlrpc 2021-04-05 13:56:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.5 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1005