-
Notifications
You must be signed in to change notification settings - Fork 840
remap_acl speedup via config reload #12540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8d5e7cf
to
4aee8e5
Compare
Adding @brbzull0 for the config update logic. I ran into bugs when I updated the |
This is getting more complicated because some tests were broken due to the longer reload interval. I will hold off on this remap_reload update until I fix the other issues in a separate PR: In the meantime, I'll make this as a draft and rebase once that lands. |
c0e7ec8
to
e92cc3f
Compare
/cc @mattyw |
This changes the remap_acl.test.py test to use config reloads instead of spinning up new ATS insteads for every TestRun. Now that we've reduced our reload scanning interval via apache#12541, these reloads in test are pretty quick. Before: ``` ./autest.sh --sandbox /tmp/sb --clean=none -f remap_acl 171.62s user 57.13s system 52% cpu 7:12.57 total ``` After: ``` ./autest.sh --sandbox /tmp/sb --clean=none -f remap_acl 14.39s user 10.78s system 19% cpu 2:09.23 total ```
e92cc3f
to
88b5a24
Compare
if call_reload: | ||
# | ||
# Update the ATS configuration. | ||
# | ||
tr = Test.AddTestRun("Change the ATS configuration") | ||
p = tr.Processes.Default | ||
p.Command = ( | ||
f'traffic_ctl config set proxy.config.http.connect_ports {server_port} && ' | ||
f'traffic_ctl config set proxy.config.url_remap.acl_behavior_policy {self._acl_behavior_policy}') | ||
|
||
p.Env = ts.Env | ||
tr.StillRunningAfter = ts | ||
|
||
remap_cfg_path = os.path.join(ts.Variables.CONFIGDIR, 'remap.config') | ||
ip_allow_path = os.path.join(ts.Variables.CONFIGDIR, 'ip_allow.yaml') | ||
p.Setup.Lambda( | ||
lambda: update_config_file( | ||
remap_cfg_path, '\n'.join(remap_config_lines), ip_allow_path, '\n'.join(self._ip_allow_lines))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the heart of this patch:
- For the first test run, start ATS via MakeATSProcess (see the
else:
below this). - For subsequent test runs, update the config and do a config reload instead of starting a new test process. Doing a config reload is faster than starting a brand new ATS process for every test run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I like this reloading idea!
This changes the remap_acl.test.py test to use config reloads instead of
spinning up new ATS insteads for every TestRun. Now that we've reduced
our reload scanning interval via #12541, these reloads in test are
pretty quick.
Before:
After:
So the time to run this test goes from about 7 minutes to about 2 minutes.