Giter Site home page Giter Site logo

aks-latency-detection's Introduction

AKS-Latency-Detection

Dan Grecoe - A Microsoft Employee

This code is directly related to deployments of two real time Machine/Deep Learning scoring paths :

Overview

During a project in which a DL model was deployed to a GPU cluster in Azure Kubernetes Service, it became clear that the response times, i.e. latency, of the endpoint did not match expectations.

Looking at the cluster through the Kubernetes Dashboard was not telling us much, but we knew that the model logged out how long it took to score a single record.

With that knowledge, this set of scripts are used to:

  1. Let the user choose which kubectl context to go after.
  2. Let the user choose the deployment from that cluster to collect and analyze logs for.
  3. Determine the number of replicas (pods) that have been allocated to the service.
  4. Download the logs and parse them for useful information.
  5. Search by request ID once parsing is complete to find individual transactions.

Pre-Requisites

  • You have an AKS cluster with either the DL or ML model deployed to it. You can have many, but it is required to at least have one.
  • Install kubectl onto your machine.
  • Have collected the credentials from the AKS cluster using
    • az aks get-credentials -g [resource_group] -n [cluster_name]
  • Have minimum Python 3.6.1 installed on your machine.
  • Have cloned this repository

Running the script

The main script is realTimeScoringStats.py, this file will prompt you along the way when needed to collect the information it needs to parse the log files.

When running, it will download log files from each pod to the directory in which the script runs in the form:

    [pod_name].txt

Results will be dumped to a file in the same directory from which the script runs in the form :

    [aks_deployment_name]_results.txt

For each pod/replica in the deployment in which a log was captured, an entry in the results file will be created in the form:

File : yourdeployname-6fc5cf8df6-sdxld.txt
Times (6452):
	 Earliest: 2019-10-17 13:00:30
	 Latest: 2019-10-17 13:08:48
	 Time in minutes: 8.3
Scoring Calls (6452):
	 Average: 70.46944048357093 ms
	 Slowest: 81.43 ms
	 Fastest: 68.63 ms
	 Throughput: 12.955823293172688 RPS

Hint:

When prompted to pick your namespace, you will be presented with a list such as:

List of namespaces (deployment) found :
1 - azureml-dangaksdeploydl3 (dangdeploy3)
2 - default (azureml-ba)
3 - default (azureml-fe)
4 - kube-system (coredns)
5 - kube-system (coredns-autoscaler)
6 - kube-system (kubernetes-dashboard)
7 - kube-system (metrics-server)
8 - kube-system (tunnelfront)
Enter the integer selection for a namespace >

Choose the one that stars with azureml-

aks-latency-detection's People

Contributors

grecoe avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.