Saarthi

Saarthi: Intelligent Serverless Computing Platform

Saarthi: Intelligent Serverless Computing

๐ŸŽฏ Vision Statement

Saarthi is an intelligent, end-to-end serverless computing platform that revolutionizes how we handle complex computational workloads in distributed environments. Named after the Sanskrit word for โ€œcharioteerโ€ - the guide who steers the chariot to victory - Saarthi guides serverless functions to optimal performance through intelligent orchestration, prediction, and resource management.

๐ŸŒŸ What is Saarthi?

Saarthi is a comprehensive serverless management platform built on OpenFaaS that addresses the fundamental challenges of modern serverless computing:

The Problem We Solve

Traditional serverless platforms suffer from:

How Saarthi Addresses These Challenges

Saarthi transforms serverless computing through proactive intelligence:

๐Ÿ—๏ธ System Architecture & End-to-End Workflow

High-Level Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                           SAARTHI PLATFORM                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚   PREDICTION    โ”‚    โ”‚  OPTIMIZATION   โ”‚    โ”‚   EXECUTION     โ”‚            โ”‚
โ”‚  โ”‚     LAYER       โ”‚โ”€โ”€โ”€โ”€โ”‚     LAYER       โ”‚โ”€โ”€โ”€โ”€โ”‚     LAYER       โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚           โ”‚                       โ”‚                       โ”‚                    โ”‚
โ”‚           โ–ผ                       โ–ผ                       โ–ผ                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚ Workload        โ”‚    โ”‚ ILP Controller  โ”‚    โ”‚ Custom Gateway +โ”‚            โ”‚
โ”‚  โ”‚ Predictor       โ”‚    โ”‚ (Greedy + Full) โ”‚    โ”‚ K8s Provider   โ”‚            โ”‚
โ”‚  โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚                 โ”‚            โ”‚
โ”‚  โ”‚ โ€ข Time Series   โ”‚    โ”‚ โ€ข Utility-Based โ”‚    โ”‚ โ€ข Idle-First    โ”‚            โ”‚
โ”‚  โ”‚ โ€ข Parameter     โ”‚    โ”‚   Optimization  โ”‚    โ”‚   Pod Selection โ”‚            โ”‚
โ”‚  โ”‚   Distribution  โ”‚    โ”‚ โ€ข Coverage &    โ”‚    โ”‚ โ€ข Pod Status    โ”‚            โ”‚
โ”‚  โ”‚ โ€ข Resource      โ”‚    โ”‚   Utility       โ”‚    โ”‚   Registry      โ”‚            โ”‚
โ”‚  โ”‚   Estimation    โ”‚    โ”‚   Maximization  โ”‚    โ”‚ โ€ข Request       โ”‚            โ”‚
โ”‚  โ”‚                 โ”‚    โ”‚ โ€ข Overprovision โ”‚    โ”‚   Queuing       โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚           โ”‚                       โ”‚                       โ”‚                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚           โ–ผ                       โ–ผ                       โ–ผ                    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚  โ”‚                    MONITORING & FEEDBACK LAYER                             โ”‚
โ”‚  โ”‚                                                                             โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚  โ”‚  โ”‚ Custom      โ”‚  โ”‚ Performance โ”‚  โ”‚ Resource    โ”‚  โ”‚ Cost        โ”‚      โ”‚
โ”‚  โ”‚  โ”‚ Dashboard   โ”‚  โ”‚ Metrics     โ”‚  โ”‚ Usage       โ”‚  โ”‚ Analytics   โ”‚      โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ”‚
                                      โ–ผ
               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
               โ”‚              OPENFAAS INFRASTRUCTURE                    โ”‚
               โ”‚                                                         โ”‚
               โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
               โ”‚  โ”‚   Nodes     โ”‚  โ”‚  Functions  โ”‚  โ”‚   Storage   โ”‚     โ”‚
               โ”‚  โ”‚             โ”‚  โ”‚             โ”‚  โ”‚             โ”‚     โ”‚
               โ”‚  โ”‚ โ€ข Worker 1  โ”‚  โ”‚ โ€ข Function Aโ”‚  โ”‚ โ€ข Volumes   โ”‚     โ”‚
               โ”‚  โ”‚ โ€ข Worker 2  โ”‚  โ”‚ โ€ข Function Bโ”‚  โ”‚ โ€ข Configs   โ”‚     โ”‚
               โ”‚  โ”‚ โ€ข Worker N  โ”‚  โ”‚ โ€ข Function Cโ”‚  โ”‚ โ€ข Secrets   โ”‚     โ”‚
               โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ End-to-End Workflow: Request Processing Journey

Phase 1: Prediction & Planning (Proactive)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. WORKLOAD PREDICTION PHASE                                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚  Historical Data โ”€โ”€โ–บ Pattern Analysis โ”€โ”€โ–บ Future Workload Prediction           โ”‚
โ”‚       โ”‚                    โ”‚                         โ”‚                         โ”‚
โ”‚       โ–ผ                    โ–ผ                         โ–ผ                         โ”‚
โ”‚  โ€ข Past requests      โ€ข Seasonal patterns      โ€ข Request counts              โ”‚
โ”‚  โ€ข Resource usage     โ€ข Peak hours             โ€ข Parameter distributions      โ”‚
โ”‚  โ€ข Performance       โ€ข Function correlations   โ€ข Resource requirements       โ”‚
โ”‚    metrics            โ€ข Input characteristics   โ€ข Confidence intervals        โ”‚
โ”‚                                                                                 โ”‚
โ”‚  Output: "In next 30 minutes, expect 150 requests to matrix_mult with         โ”‚
โ”‚          n=[100,500,800], m=[200,400,600], requiring ~2.5 CPU cores"          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. OPTIMIZATION PHASE                                                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚  Predicted Workload โ”€โ”€โ–บ ILP Solver โ”€โ”€โ–บ Optimal Resource Allocation             โ”‚
โ”‚         โ”‚                   โ”‚                      โ”‚                          โ”‚
โ”‚         โ–ผ                   โ–ผ                      โ–ผ                          โ”‚
โ”‚  โ€ข Function demands    โ€ข Maximize coverage   โ€ข Node assignments               โ”‚
โ”‚  โ€ข Resource needs      โ€ข Minimize cold startsโ€ข CPU allocations                โ”‚
โ”‚  โ€ข Coverage targets    โ€ข Optimize utility    โ€ข Memory allocations             โ”‚
โ”‚  โ€ข Node capacities     โ€ข Respect constraints โ€ข Replica counts                 โ”‚
โ”‚                                                                                 โ”‚
โ”‚  Mathematical Model:                                                            โ”‚
โ”‚  Maximize: ฮฃ(utility ร— coverage_score) - ฮฃ(cold_start_penalty ร— violations)   โ”‚
โ”‚  Subject to: CPU/Memory limits, Coverage requirements, Resource constraints    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Phase 2: Deployment & Execution (Reactive)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. DEPLOYMENT PHASE                                                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚  Optimization Plan โ”€โ”€โ–บ Function Deployment โ”€โ”€โ–บ Resource Allocation             โ”‚
โ”‚         โ”‚                      โ”‚                        โ”‚                     โ”‚
โ”‚         โ–ผ                      โ–ผ                        โ–ผ                     โ”‚
โ”‚  โ€ข Node assignments       โ€ข Scale functions        โ€ข CPU allocation           โ”‚
โ”‚  โ€ข Resource targets       โ€ข Deploy new instances   โ€ข Memory assignment        โ”‚
โ”‚  โ€ข SLA requirements       โ€ข Update configurations  โ€ข Network setup           โ”‚
โ”‚                           โ€ข Health checks          โ€ข Storage mounting        โ”‚
โ”‚                                                                                 โ”‚
โ”‚  Result: Functions pre-deployed and ready for incoming requests               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 4. REQUEST EXECUTION PHASE                                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚   Incoming Request โ”€โ”€โ–บ Intelligent Routing โ”€โ”€โ–บ Function Execution              โ”‚
โ”‚         โ”‚                       โ”‚                        โ”‚                    โ”‚
โ”‚         โ–ผ                       โ–ผ                        โ–ผ                    โ”‚
โ”‚  โ€ข Client request         โ€ข Idle-first selection   โ€ข Function invocation      โ”‚
โ”‚  โ€ข Input parameters       โ€ข Pod status registry    โ€ข Resource usage           โ”‚
โ”‚  โ€ข Authentication         โ€ข Request queuing        โ€ข Performance monitoring   โ”‚
โ”‚  โ€ข Headers/metadata       โ€ข Max in-flight control  โ€ข Result processing        โ”‚
โ”‚                                                                                 โ”‚
โ”‚   Journey: Request โ†’ Gateway โ†’ K8s Provider โ†’ Pod Selection โ†’ Function โ†’ Responseโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Phase 3: Monitoring & Adaptation (Continuous)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 5. MONITORING & FEEDBACK PHASE                                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                                 โ”‚
โ”‚  Execution Metrics โ”€โ”€โ–บ Analysis & Learning โ”€โ”€โ–บ Model Improvement               โ”‚
โ”‚         โ”‚                      โ”‚                        โ”‚                     โ”‚
โ”‚         โ–ผ                      โ–ผ                        โ–ผ                     โ”‚
โ”‚  โ€ข Response times         โ€ข Pattern detection      โ€ข Model retraining         โ”‚
โ”‚  โ€ข Resource usage         โ€ข Anomaly identification โ€ข Parameter tuning         โ”‚
โ”‚  โ€ข Error rates            โ€ข Accuracy measurement   โ€ข Algorithm improvement     โ”‚
โ”‚  โ€ข Cost metrics           โ€ข Trend analysis         โ€ข Feedback integration     โ”‚
โ”‚                                                                                 โ”‚
โ”‚  Continuous Loop: Monitor โ†’ Learn โ†’ Predict โ†’ Optimize โ†’ Deploy โ†’ Execute     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿงฉ Component Deep Dive

1. Prediction Service (prediction-service/)

Purpose: Forecasts multi-dimensional workload patterns Key Innovation: Predicts both request volumes AND input parameter distributions

# Example: Matrix multiplication function prediction
prediction = {
    "function_name": "matrix_mult",
    "predicted_request_count": 150,
    "predicted_parameters": [
        {"n": 512, "m": 256}, {"n": 1024, "m": 512}, ...
    ],
    "estimated_resources": {
        "cpu_cores": 2.5, "memory_mb": 1024, "execution_time_ms": 5000
    },
    "confidence_score": 0.87
}

Technologies: Random Forest, Statistical Distribution Learning, Time Series Analysis

2. ILP Controller (greedy-ilp/)

Purpose: Mathematical optimization for resource allocation and function placement Key Innovation: Utility-based optimization with multi-constraint satisfaction

Objective Function:
Maximize: ฮฃ(utility ร— coverage_ratio) - ฮฃ(beta ร— overprovisioning_penalty)

Where:
- 'utility' is the importance weight per function
- 'coverage_ratio' is the percentage of expected requests served
- 'beta' is the penalty coefficient for overprovisioning
- Overprovisioning penalty applies when instances exceed needs

Constraints:
- Total CPU across all instances <= cluster CPU capacity
- Total memory across all instances <= cluster memory capacity
- Function replica counts within min/max bounds
- Request assignments respect instance capacity limits

Technologies: Integer Linear Programming, Greedy Heuristics, Utility-Based Allocation, Multi-Constraint Optimization

3. Custom Gateway (openfaas-custom-gateway/)

Purpose: Intelligent request routing with pod status awareness Key Innovation: Idle-first pod selection and intelligent retry logic

Flow:

  1. Receive client request and validate authentication
  2. Track pod status (idle/busy) using internal status registry
  3. Select optimal pod using idle-first strategy to minimize wait times
  4. Route request with circuit breaker protection for fault tolerance
  5. Implement intelligent retry logic for failed requests
  6. Cache function metadata and status information
  7. Monitor and collect detailed performance metrics

Key Features:

4. Custom Kubernetes Provider (openfaas-custom-faas-netes/)

Purpose: Kubernetes-native function management with intelligent pod tracking Key Innovation: Centralized pod status registry and function-aware scheduling

Flow:

  1. Expose pod status management APIs to the gateway
  2. Track pod idle/busy states across function deployments
  3. Maintain a real-time registry of pod status information
  4. Support intelligent load balancing and routing decisions
  5. Provide queue management for high-demand functions

Key Features:

5. Custom Scheduler (openfaas-scheduler-python/)

Purpose: Function placement and scaling decisions Key Innovation: Proactive scaling based on predictions

Algorithms:

6. Custom Dashboard (openfaas-custom-dashboard/)

Purpose: Real-time monitoring and management interface Key Innovation: Multi-dimensional visualization of predictions vs. actuals

Features:

7. Rebalancer APIs (single-rebalancer-api/, multi-rebalancer-api/)

Purpose: Dynamic resource rebalancing Key Innovation: Continuous optimization during runtime

Triggers:

๐ŸŽฏ Core Objectives & Goals

Primary Objectives

  1. ๐ŸŽฏ Performance Optimization
    • Minimize function cold starts through predictive pre-scaling
    • Reduce response latency via intelligent placement
    • Maximize resource utilization efficiency
  2. ๐Ÿ’ฐ Cost Minimization
    • Optimal resource allocation to minimize cloud costs
    • Eliminate over-provisioning through accurate predictions
    • Dynamic scaling based on actual vs. predicted demand
  3. ๐Ÿ“Š SLA Compliance
    • Guarantee response time SLAs through proactive scaling
    • Ensure availability targets via intelligent load balancing
    • Maintain consistency through resource reservation
  4. ๐Ÿ”ฎ Predictive Intelligence
    • Learn from historical patterns to predict future workloads
    • Adapt to changing usage patterns automatically
    • Provide insights for capacity planning

Key Performance Indicators (KPIs)

Metric Target Expected Achievement
Cold Start Reduction > 70% 65-80%
Cost Optimization > 40% 35-50%
SLA Compliance > 99% 97-99.5%
Prediction Accuracy > 85% 80-90%
Resource Utilization > 80% 75-85%

๐Ÿ”ฌ Technical Innovations

1. Multi-Dimensional Workload Prediction

Traditional Approach: โ€œExpect 100 requests/minuteโ€ Saarthi Approach: โ€œExpect 100 requests with specific input distributions requiring predictable resourcesโ€

2. Mathematical Resource Optimization

Traditional Approach: Heuristic-based scaling rules Saarthi Approach: ILP-based optimal resource allocation with mathematical guarantees

3. Prediction-Aware Scheduling

Traditional Approach: Reactive placement after requests arrive Saarthi Approach: Proactive placement based on predicted workload patterns

4. Intelligent Request Routing

Traditional Approach: Round-robin or simple load balancing Saarthi Approach: Idle-first pod selection with real-time status awareness and intelligent retry logic

๐Ÿ› ๏ธ Design Considerations & Trade-offs

Why These Choices?

1. Why ILP for Optimization?

Pros:

Cons:

Our Solution: Hybrid approach with greedy fallback for time-critical decisions

2. Why Custom Gateway & K8s Provider?

Pros:

Cons:

Our Solution: Built on OpenFaaS foundation, with custom K8s provider for advanced pod tracking and intelligent routing

3. Why Prediction-First Architecture?

Pros:

Cons:

Our Solution: Graceful degradation when predictions are unavailable

Alternative Approaches Considered

  1. Rule-Based Scaling: Simple but inflexible
  2. Reactive Optimization: Lower complexity but suboptimal performance
  3. Centralized vs. Distributed: Chose hybrid approach for scalability
  4. Real-time vs. Batch Optimization: Chose real-time for responsiveness

๐Ÿš€ Implementation Journey

Phase 1: Foundation (Completed)

Phase 2: Intelligence (Completed)

Phase 3: Optimization (Current)

Phase 4: Advanced Features (Planned)

๐Ÿ“Š Real-World Impact & Use Cases

Use Case 1: E-commerce Platform

Scenario: Online shopping platform with seasonal traffic patterns Challenge: Black Friday traffic spikes causing system failures Saarthi Solution:

Use Case 2: Data Analytics Pipeline

Scenario: Financial institution running real-time fraud detection Challenge: Variable data volumes causing processing delays Saarthi Solution:

Use Case 3: IoT Data Processing

Scenario: Smart city platform processing sensor data Challenge: Unpredictable sensor failure patterns Saarthi Solution:

๐ŸŒŸ Expected Competitive Advantages

vs. AWS Lambda

vs. Kubernetes HPA

vs. Apache OpenWhisk

๐Ÿ”ฎ Future Roadmap

Short-term (3-6 months)

Medium-term (6-12 months)

Long-term (1-2 years)

๐Ÿค Contributing to Saarthi

For Developers

# Setup development environment
git clone <repository>
cd Saarthi
./scripts/setup-dev-environment.sh

# Run component tests
./scripts/test-all-components.sh

# Deploy to test cluster
./scripts/deploy-test-environment.sh

For Researchers

For Operators

๐Ÿ“š Research & Publications

Core Research Areas

  1. Serverless Computing Optimization
  2. Workload Prediction in Distributed Systems
  3. Integer Linear Programming for Resource Allocation
  4. Multi-Objective Optimization in Cloud Computing

Publications (Planned)

๐Ÿ“ž Contact & Support

Project Maintainers

Getting Help


๐ŸŽฏ Quick Start Guide

Prerequisites

Installation

# 1. Clone Saarthi
git clone <repository>
cd Saarthi

# 2. Deploy prediction service
cd prediction-service
./start_service.sh --install-deps
kubectl apply -f k8s-deployment.yaml

# 3. Deploy ILP controller
cd ../greedy-ilp
./deploy.sh

# 4. Deploy custom components
cd ../openfaas-custom-gateway
./build-and-deploy.sh

# 5. Access dashboard
kubectl port-forward svc/saarthi-dashboard 8080:80
# Open http://localhost:8080

First Steps

  1. Monitor Dashboard: Observe initial metrics
  2. Deploy Test Function: Deploy a sample function
  3. Generate Load: Use load testing to see optimization
  4. View Predictions: Check prediction accuracy
  5. Analyze Results: Review cost and performance improvements

Saarthi - Guiding serverless computing to optimal performance Version: 2.0.0 | Last Updated: July 3, 2025