gaoshao52 / PBScaler

PBScaler: A Bottleneck-aware Autoscaling Framework for Microservice-based Applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PBScaler

PBScaler: A Bottleneck-aware Autoscaling Framework for Microservice-based Applications

PBScaler is a bottleneck-aware autoscaling framework designed to prevent performance degradation in microservice-based application.

Enviroment

Software Version
Kubernetes 1.20.4
Istio 1.13.4

Deploy benchmarks

  1. Train Ticket
cd benchmarks/train-ticket/deployment/kubernetes-manifests/quickstart-k8s

# Deploy the databases
kubectl apply -f quickstart-ts-deployment-part1.yml
# Deploy the services
kubectl apply -f quickstart-ts-deployment-part2.yml
# Deploy the UI Dashboard
kubectl apply -f quickstart-ts-deployment-part3.yml
  1. Online-boutique
cd benchmarks/microservices-demo/release/
kubectl apply -f kubernetes-manifests.yaml

Getting Started

Clone the Repo

git clone --depth=1 https://github.com/WHU-AISE/PBScaler.git

Install Dependencies

pip install -r requirements.txt

Write Configuration

Make these changes based on your local configuration and environment

import time

def getNowTime():
    return int(round(time.time()))

class Config():
    def __init__(self):

        self.namespace = 'default'
        # self.nodes = {
        #     'ubuntu-Precision-Tower-7810': '192.168.31.202:9100',
        #     'dell': '192.168.31.201:9100',
        #     'node1': '192.168.31.136:9100'
        # }

        self.SLO = 200
        # maximum and minimum number of pods for a microservice
        self.max_pod = 8
        self.min_pod = 1

        # k8s config path
        self.k8s_config = '/home/ubuntu/xsy/config'
        self.k8s_yaml = '/home/ubuntu/xsy/microservices-demo/release/kubernetes-manifests.yaml'
        
        # experiment duration
        self.duration = 1 * 20 * 60 # 20 min
        self.start = getNowTime()
        self.end = self.start + self.duration

        # prometheus
        self.prom_range_url = "http://192.168.31.202:32030/api/v1/query_range"
        self.prom_no_range_url = "http://192.168.31.202:32030/api/v1/query"
        self.step = 5

Train a SLO violation preditor

Before doing this, you'll need to recollect historical data for the cluster. The data in the simulation folder is just the samples

cd simulation
python RandomForestClassify.py

Run

python main.py

Citation

@misc{xie2023pbscaler,
      title={PBScaler: A Bottleneck-aware Autoscaling Framework for Microservice-based Applications}, 
      author={Shuaiyu Xie and Jian Wang and Bing Li and Zekun Zhang and Duantengchuan Li and Patrick C. K. H},
      year={2023},
      eprint={2303.14620},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}

About

PBScaler: A Bottleneck-aware Autoscaling Framework for Microservice-based Applications

License:MIT License


Languages

Language:Java 46.7%Language:JavaScript 20.9%Language:HTML 15.9%Language:Python 10.7%Language:Go 2.3%Language:CSS 1.5%Language:Shell 0.7%Language:Dockerfile 0.6%Language:C# 0.6%Language:FreeMarker 0.0%Language:Makefile 0.0%