Back to search

Chalmers University of Technology

Predictive Resource Tuning of Apache Spark Jobs in Kubernetes - A Machine Learning driven approach, with uncertainty aware predictions

Abstract

dc:description.abstract

Apache Spark is a widely used distributed data processing engine for large-scale analytics and machine learning workloads, typically executed in multi-node cluster environments. Kubernetes is increasingly used to deploy and manage these workloads in container orchestration, resource scheduling, and scalable cluster management. Despite this infrastructure, Spark workloads require users to specify CPU and memory allocations in advance. In practice, these resource requests are often overestimated to prevent job failures under uncertain workload requirements. This leads to inefficient resource utilization in shared clusters, reduced overall throughput, and increased operational cost in multi-tenant environments. This thesis addresses the problem of static and overly conservative resource provisioning for Spark jobs running on Kubernetes. This thesis proposes a machine learning-based resource tuning system that learns from historical execution behavior to predict more accurate resource allocations for defined workload types. In addition, the system incorporates uncertainty awareness to ensure that resource adjustments are applied more conservatively when prediction confidence is low. The proposed approach aims to reduce resource overprovisioning while maintaining execution stability, thereby improving cluster efficiency in distributed Spark environments. The results demonstrate that the tuning approach reduced memory from 64 GB to 8 GB and cores from 4 to 1 per executor for a designed test job. The total savings was 616 GB of memory and 30 cores per such job after tuning for 40 iterations. This increased resource utilization, although execution time increased by approximately 55%. Uncertainty-aware Wilson intervals were successfully incorporated into memory tuning but not core tuning due to its continuous cost-based optimization objective.

Degree

thesis:*
Level thesis:degree_level
H
Department dc:contributor.department
Chalmers tekniska högskola / Institutionen för data och informationsteknik
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Authors dc:creator
  • Ndirangu, Leah Wanja
  • Petersson, Alexander
Advisor dc:contributor.supervisor
  • Hassan, Ahmed Ali-Eldin
Committee member dc:contributor.committeemember
  • Hassan, Ahmed Ali-Eldin

Subjects

dc:subject × 1

Rights

Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Coursecode
DATX05

Chain of custody

source
Harvested from
Chalmers University of Technology
Base URL
odr.chalmers.se/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Ndirangu, Leah Wanja; Petersson, Alexander. Predictive Resource Tuning of Apache Spark Jobs in Kubernetes - A Machine Learning driven approach, with uncertainty aware predictions. H thesis, 2026. https://hdl.handle.net/20.500.12380/312611