Optimizations for tempest tests
This patch does the following: * Reduces interval between checks when waiting on amphora status in a devstack environment. At the same time we increase the number of retries so we are effectively waiting the same total time before a timeout error occurs. * Disables DNS resolution on the amphora image. Amphorae don't need to do any DNS resolution anyway since any outbound connections are done specifying IP addresses. This means that the amphora never waits for DNS timeouts to occur when booting and performing other tasks when operating in an environment where DNS resolution doesn't work (ie. devstack) In preliminary tests, the above optimizations seem to shave about 50-55 seconds off per test. (This is mostly due to the elimination of DNS timeouts.) Change-Id: Icc7d8e0ac18a4a18ed9eb0950081ddd198cf4684
This commit is contained in:
@@ -87,6 +87,12 @@ function octavia_configure {
|
||||
iniuncomment $OCTAVIA_CONF haproxy_amphora connection_max_retries
|
||||
iniuncomment $OCTAVIA_CONF haproxy_amphora connection_retry_interval
|
||||
|
||||
# devstack optimizations for tempest runs
|
||||
iniset $OCTAVIA_CONF haproxy_amphora connection_max_retries 1500
|
||||
iniset $OCTAVIA_CONF haproxy_amphora connection_retry_interval 1
|
||||
iniset $OCTAVIA_CONF controller_worker amp_active_retries 100
|
||||
iniset $OCTAVIA_CONF controller_worker amp_active_wait_sec 1
|
||||
|
||||
if [[ -a $OCTAVIA_SSH_DIR ]] ; then
|
||||
rm -rf $OCTAVIA_SSH_DIR
|
||||
fi
|
||||
|
||||
@@ -327,6 +327,9 @@ if [ "$AMP_ROOTPW" ]; then
|
||||
export DIB_PASSWORD=$AMP_ROOTPW
|
||||
fi
|
||||
|
||||
# Add the devstack no-resolvconf hack
|
||||
AMP_element_sequence="$AMP_element_sequence no-resolvconf"
|
||||
|
||||
# Add the Octavia Amphora agent.py element
|
||||
AMP_element_sequence="$AMP_element_sequence amphora-agent"
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
This element clears out /etc/resolv.conf and prevents dhclient from populating
|
||||
it with data from DHCP. This means that DNS resolution will not work from the
|
||||
amphora. This is OK because all outbound connections from the amphora will
|
||||
be based using raw IP addresses.
|
||||
|
||||
This has the real benefit of speeding up host boot and configutation times.
|
||||
This is especially helpful when running tempest tests in a devstack environment
|
||||
where DNS resolution from the amphora usually doesn't work anyway: This means
|
||||
that the amphora never waits for DNS timeouts to occur.
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
echo "" > /etc/resolv.conf
|
||||
echo "" > /etc/resolv.conf.ORIG
|
||||
echo "#!/bin/sh
|
||||
make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
||||
chmod +x /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
||||
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolvconf
|
||||
@@ -177,7 +177,8 @@ haproxy_amphora_opts = [
|
||||
help=_('Retry threshold for connecting to amphorae.')),
|
||||
cfg.IntOpt('connection_retry_interval',
|
||||
default=5,
|
||||
help=_('Retry timeout between attempts in seconds.')),
|
||||
help=_('Retry timeout between connection attempts in '
|
||||
'seconds.')),
|
||||
cfg.StrOpt('haproxy_stick_size', default='10k',
|
||||
help=_('Size of the HAProxy stick table. Accepts k, m, g '
|
||||
'suffixes. Example: 10k')),
|
||||
@@ -210,7 +211,8 @@ controller_worker_opts = [
|
||||
help=_('Retry attempts to wait for Amphora to become active')),
|
||||
cfg.IntOpt('amp_active_wait_sec',
|
||||
default=10,
|
||||
help=_('Seconds to wait for an Amphora to become active')),
|
||||
help=_('Seconds to wait between checks on whether an Amphora '
|
||||
'has become active')),
|
||||
cfg.StrOpt('amp_flavor_id',
|
||||
default='',
|
||||
help=_('Nova instance flavor id for the Amphora')),
|
||||
|
||||
Reference in New Issue
Block a user