placement/gate/perfload-server.sh
Chris Dent ed03085187 Add apache benchmark (ab) to end of perfload jobs
Start the process of reporting some concurrency numbers by including
a 500 x 10 'ab' run against the query URL used in each perfload job.

There's duplication removal that could be done here, but we leave
that until we've determined if this is working well.

The PLACEMENT_URL is updated to use 127.0.0.1 instead of localhost;
ab will attempt to use the IPV6 version of localhost if that's the
case, and we've not bound the placement server to that interface.

The timeout on the placement-nested-perfload job has been raised to
1 hour as the default 30 minutes is leading to a timeout. If that's
still not enough we'll explore lowering concurrency.

We will quite likely need to adapt the mysql configuration if we
intend to continue down this road.

Change-Id: Ic0bf2ab666dab546dd7b03955473c246fd0f380a
2019-08-06 09:18:44 +01:00

31 lines
1.3 KiB
Bash
Executable File

#!/bin/bash -x
WORK_DIR=$1
# create database
sudo debconf-set-selections <<MYSQL_PRESEED
mysql-server mysql-server/root_password password secret
mysql-server mysql-server/root_password_again password secret
mysql-server mysql-server/start_on_boot boolean true
MYSQL_PRESEED
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev jq parallel apache2-utils
sudo mysql -uroot -psecret -e "DROP DATABASE IF EXISTS placement;"
sudo mysql -uroot -psecret -e "CREATE DATABASE placement CHARACTER SET utf8;"
sudo mysql -uroot -psecret -e "GRANT ALL PRIVILEGES ON placement.* TO 'root'@'%' identified by 'secret';"
# Create a virtualenv for placement to run in
python -m virtualenv -p python3 .placement
. .placement/bin/activate
pip install . PyMySQL uwsgi
# set config via environment
export OS_PLACEMENT_DATABASE__CONNECTION=mysql+pymysql://root:secret@127.0.0.1/placement?charset=utf8
export OS_PLACEMENT_DATABASE__MAX_POOL_SIZE=25
export OS_PLACEMENT_DATABASE__MAX_OVERFLOW=100
export OS_PLACEMENT_DATABASE__SYNC_ON_STARTUP=True
# Increase our chances of allocating to different providers.
export OS_PLACEMENT_PLACEMENT__RANDOMIZE_ALLOCATION_CANDIDATES=True
export OS_DEFAULT__DEBUG=True
export OS_API__AUTH_STRATEGY=noauth2
uwsgi --http :8000 --wsgi-file .placement/bin/placement-api --daemonize ${WORK_DIR}/logs/placement-api.log --processes 5 --threads 25