Browbeat
This commit is contained in:
parent
9e83e1732d
commit
8cf3a4c715
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,150 @@
|
|||
#!/bin/bash
|
||||
source ~/stackrc
|
||||
DEBUG=true
|
||||
#WORKERS="metadata_workers|osapi_compute_workers|ec2_workers|public_workers|admin_workers|rpc_workers|api_workers"
|
||||
CONTROLLERS=$(nova list | grep control)
|
||||
SSH_OPTS="StrictHostKeyChecking no"
|
||||
declare -A WORKERS
|
||||
WORKERS["keystone"]="public_workers|admin_workers"
|
||||
WORKERS["nova"]="metadata_workers|osapi_compute_workers|ec2_workers"
|
||||
WORKERS["neutron"]="rpc_workers|api_workers"
|
||||
|
||||
#
|
||||
# So this function pulls the current config from the hosts and just presents it -- doesn't store or use it... we could change this.
|
||||
#
|
||||
|
||||
check_controllers()
|
||||
{
|
||||
for IP in $(echo "$CONTROLLERS" | awk '{print $12}' | cut -d "=" -f 2); do
|
||||
# Number of cores?
|
||||
CORES=$(ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cat /proc/cpuinfo | grep processor | wc -l)
|
||||
echo " ------------------- Controller : $IP -------------------"
|
||||
echo " -- Number of cores : $CORES --"
|
||||
echo " :::: Service : Keystone ::::"
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cat /etc/keystone/keystone.conf | grep -vi "NONE" | grep -v "#" |grep -E ${WORKERS["keystone"]}
|
||||
echo " :::: Service : Nova ::::"
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cat /etc/nova/nova.conf | grep -vi "NONE" | grep -v "#" |grep -E ${WORKERS["nova"]}
|
||||
echo " :::: Service : Neutron ::::"
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cat /etc/neutron/neutron.conf | grep -vi "NONE" | grep -v "#" |grep -E ${WORKERS["neutron"]}
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# This will update each of the functions - we pass which one to update.
|
||||
#
|
||||
|
||||
update_workers()
|
||||
{
|
||||
declare -A services
|
||||
services["keystone"]="/etc/keystone/keystone.conf"
|
||||
services["nova"]="/etc/nova/nova.conf"
|
||||
services["neutron"]="/etc/neutron/neutron.conf"
|
||||
|
||||
if [ -z "$1" ] ; then
|
||||
echo "ERROR : Pass # of workers to use"
|
||||
exit 1
|
||||
else
|
||||
echo " Setting : $1 for number of workers"
|
||||
wkr_count=$1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
echo "ERROR : Pass which service to update"
|
||||
echo "Usage : update_workers COUNT SERVICE"
|
||||
echo "Valid services : keystone, nova, neutron"
|
||||
exit 1
|
||||
else
|
||||
echo "Updating : $2"
|
||||
osp_service=$2
|
||||
fi
|
||||
|
||||
for IP in $(echo "$CONTROLLERS" | awk '{print $12}' | cut -d "=" -f 2); do
|
||||
#for i in $(echo $WORKERS | tr "|" "\n") ; do
|
||||
for i in $(echo ${WORKERS[$osp_service]} | tr "|" "\n") ; do
|
||||
echo "Copying Config files"
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cp ${services[$osp_service]} ${services[$osp_service]}-copy
|
||||
#ssh -o "${SSH_OPTS}" heat-admin@$IP sudo sed -i -e 's/$i.*/${i}=${wkr_count}/g' ${services[$worker]}
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "sed -i -e \"s/^\(${i}\)\( \)*=\( \)*\([0-9]\)*/${i}=${wkr_count}/g\" ${services[$osp_service]}"
|
||||
done
|
||||
done
|
||||
if [ "${osp_service}" == "keystone" ]; then
|
||||
IP=`echo "$CONTROLLERS" | head -n 1 | awk '{print $12}' | cut -d "=" -f 2`
|
||||
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "pcs resource restart openstack-keystone"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
run_rally()
|
||||
{
|
||||
if [ -z "$1" ] ; then
|
||||
echo "ERROR : Pass which service to run rally tests against"
|
||||
echo "Usage : run_rally SERVICE TEST_PREFIX"
|
||||
echo "Valid services : keystone, nova, neutron"
|
||||
exit 1
|
||||
else
|
||||
echo "Benchmarking : $1"
|
||||
osp_service=$1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
echo "ERROR : Pass test_prefix to run rally tests"
|
||||
echo "Usage : run_rally SERVICE TEST_PREFIX"
|
||||
echo "Valid services : keystone, nova, neutron"
|
||||
exit 1
|
||||
else
|
||||
test_prefix=$2
|
||||
fi
|
||||
|
||||
for task_file in `ls ${osp_service}`
|
||||
do
|
||||
if [ ${task_file: -3} == "-cc" ]
|
||||
then
|
||||
#for concur in 32 64 128 256 384
|
||||
for concur in 128 256 384
|
||||
do
|
||||
times=5000
|
||||
task_dir=$osp_service
|
||||
test_name="${test_prefix}-${task_file}-${concur}"
|
||||
echo "${test_name}"
|
||||
sed -i "s/\"concurrency\": 1,/\"concurrency\": ${concur},/g" ${task_dir}/${task_file}
|
||||
sed -i "s/\"times\": 1,/\"times\": ${times},/g" ${task_dir}/${task_file}
|
||||
|
||||
rally task start --task ${task_dir}/${task_file} 2>&1 | tee ${test_name}.log
|
||||
|
||||
# grep the log file for the results to be run
|
||||
test_id=`grep "rally task results" ${test_name}.log | awk '{print $4}'`
|
||||
rally task report ${test_id} --out ${test_name}.html
|
||||
mv ${test_name}.log results/
|
||||
mv ${test_name}.html results/
|
||||
|
||||
sed -i "s/\"concurrency\": ${concur},/\"concurrency\": 1,/g" ${task_dir}/${task_file}
|
||||
sed -i "s/\"times\": ${times},/\"times\": 1,/g" ${task_dir}/${task_file}
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if $DEBUG ; then
|
||||
echo "$CONTROLLERS"
|
||||
fi
|
||||
|
||||
#
|
||||
# 1) Show the current # of workers
|
||||
# 2) Run Tests (Keystone, Nova, Neutron)
|
||||
# 3) Update # of workers per-service
|
||||
# 4) Re-Run tests above
|
||||
#
|
||||
|
||||
|
||||
check_controllers
|
||||
for num_wkrs in `seq 24 -2 2`; do
|
||||
#for num_wkrs in 12; do
|
||||
# Update number of workers
|
||||
update_workers ${num_wkrs} keystone
|
||||
# Show number of workers
|
||||
check_controllers
|
||||
# Run Rally $SERVICE test
|
||||
run_rally keystone "test001-${num_wkrs}"
|
||||
done
|
||||
update_workers 24 keystone
|
||||
check_controllers
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"Authenticate.keystone": [
|
||||
{
|
||||
"args": {},
|
||||
"context": {
|
||||
"users": {
|
||||
"project_domain": "default",
|
||||
"resource_management_workers": 30,
|
||||
"tenants": 1,
|
||||
"user_domain": "default",
|
||||
"users_per_tenant": 8
|
||||
}
|
||||
},
|
||||
"runner": {
|
||||
"concurrency": 1,
|
||||
"times": 1,
|
||||
"type": "constant"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{% set flavor_name = flavor_name or "m1.small" %}
|
||||
{
|
||||
"NovaServers.boot_and_list_server": [
|
||||
{
|
||||
"args": {
|
||||
"flavor": {
|
||||
"name": "{{flavor_name}}"
|
||||
},
|
||||
"image": {
|
||||
"name": "centos7"
|
||||
},
|
||||
"detailed": true
|
||||
},
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"times": 1,
|
||||
"concurrency": 1
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 1,
|
||||
"users_per_tenant": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
#
|
||||
# This code will increment by 10
|
||||
# @author Joe Talerico <jtaleric@redhat.com>
|
||||
#
|
||||
RALLY_JSON="nova/nova-boot-list.json"
|
||||
EXPECTED_SUCCESS="90"
|
||||
REPEAT=3
|
||||
INCREMENT=10
|
||||
TIMESTAMP=$(date +%s)·
|
||||
mkdir -p run-${REPEAT}
|
||||
|
||||
while [[ $REPEAT -gt 0 ]] ; do·
|
||||
RUN=true
|
||||
while $RUN ; do
|
||||
CONCURRENCY=`cat ${RALLY_JSON} | grep concurrency | awk '{print $2}'`
|
||||
echo "Current number of guests launching : ${CONCURRENCY}"
|
||||
RALLY_RESULT=$(rally task start ${RALLY_JSON})
|
||||
TASK=$(echo "${RALLY_RESULT}" | grep Task | grep finished | awk '{print substr($2,0,length($2)-1)}')
|
||||
RUN_RESULT=$(echo "${RALLY_RESULT}" | grep total | awk '{print $16}')
|
||||
echo " Task : ${TASK}"
|
||||
echo " Result : ${RUN_RESULT}"
|
||||
rally task report ${TASK} --out run-${REPEAT}/${TASK}.html
|
||||
rally task results ${TASK} > run-${REPEAT}/${TASK}.json
|
||||
|
||||
SUCCESS_RATE=$(echo "${RUN_RESULT}" | awk -F. '{ print $1 }')
|
||||
|
||||
if [ "${SUCCESS_RATE}" -ge "${EXPECTED_SUCCESS}" ] ; then
|
||||
NEW_CON=$(echo "`cat ${RALLY_JSON} | grep concurrency | awk '{print $2}'`+${INCREMENT}" | bc)
|
||||
sed -i "s/\"times\"\:.*$/\"times\"\: ${NEW_CON},/g" ${RALLY_JSON}
|
||||
sed -i "s/\"concurrency\"\:.*$/\"concurrency\"\: ${NEW_CON}/g" ${RALLY_JSON}
|
||||
else
|
||||
RUN=false
|
||||
sed -i "s/\"times\"\:.*$/\"times\"\: 10,/g" ${RALLY_JSON}
|
||||
sed -i "s/\"concurrency\"\:.*$/\"concurrency\"\: 10/g" ${RALLY_JSON}
|
||||
fi
|
||||
sleep 60
|
||||
done
|
||||
let REPEAT-=1
|
||||
done
|
Loading…
Reference in New Issue