kth.sePublications KTH
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Analys av strategier för lastbalanseringi aktörsbaserade mikrotjänster: Implementering och jämförelse av två strategier i Akka Cluster Sharding medstöd för dynamisk horisontell skalning
KTH, School of Engineering Sciences in Chemistry, Biotechnology and Health (CBH), Biomedical Engineering and Health Systems, Health Informatics and Logistics.
KTH, School of Engineering Sciences in Chemistry, Biotechnology and Health (CBH), Biomedical Engineering and Health Systems, Health Informatics and Logistics.
2025 (Swedish)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
Analysis of load balancing strategiesin actor based microservices : Implementation and comparison of two strategies in AkkaCluster Sharding with support for dynamic horizontal scaling (English)
Abstract [sv]

I takt med att efterfrågan på skalbara mikrotjänstbaserade system ökar, växer behovet av effektiva strategier för lastbalansering. Detta arbete undersöker hur ett aktörsbaserat system för Internet of Things (IoT), utvecklat av företaget Youmoni, kan skalas horisontellt för att förbättra systemets resiliens vid nodfel och hantering av hög belastning. Målet har varit att utvärdera två strategier för intern lastbalansering i Akka Cluster Sharding: den inbyggda LeastShardAllocationStrategy och enegenutvecklad implementation kallad CPUShardAllocationStrategy.

En prototyp utvecklades baserat på Scala och Akka, där strategierna implementerades och testades i en kontrollerad miljö baserad på Docker Swarm. Last genererades med Locust, och CPU-belastning samt shard-allokering övervakades med KamonAPM.

Resultaten visar att båda strategier uppnår lastbalansering, men att CPUShardAllocationStrategy medför fler ombalanseringar och högre overhead, särskilt vid små variationer i belastning. LeastShardAllocationStrategy presterade mer stabilt och bedömdes som mer effektiv i applikationer med jämn arbetsbörda. Slutsatsen är att strategi bör väljas utifrån belastningsmönster och krav på precision i resursfördelning.

Abstract [en]

As the demand for scalable microservice-based systems increases, so does the need for effective load balancing strategies. This work investigates how an actor-based Internet of Things (IoT) system, developed by the company Youmoni, can be horizontally scaled to improve system resilience in the event of node failures and to handle high loads. The goal has been to evaluate two internal load balancing strategies within Akka Cluster Sharding: the built-in LeastShardAllocationStrategy and a custom implementation named CPUShardAllocationStrategy.

A prototype was developed using Scala and Akka, where both strategies were implemented and tested in a controlled environment based on Docker Swarm. Load was generated using Locust, and CPU usage along with shard allocation were monitored with Kamon APM.

The results show that both strategies achieve load balancing, but CPUShardAllocationStrategy results in more rebalancing and higher overhead, particularly under small variations in load. LeastShardAllocationStrategy performed more consistently and was deemed more effective for applications with evenly distributed workloads. The conclusion is that the choice of strategy should be based on the system’s load patterns and precision requirements for resource distribution.

Place, publisher, year, edition, pages
2025.
Series
TRITA-CBH-GRU ; 2025-093
Keywords [en]
Load balancing, Horizontal scaling, Akka, Cluster Sharding, CPU load, Microservices, Docker Swarm, Locust, Kamon, IoT
Keywords [sv]
Lastbalansering, Horisontell skalning, Akka, Cluster Sharding, CPU-belastning, Mikrotjänster, Docker Swarm, Locust, Kamon, IoT
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:kth:diva-364286OAI: oai:DiVA.org:kth-364286DiVA, id: diva2:1966142
Subject / course
Computer Technology, Program- and System Development
Educational program
Bachelor of Science in Engineering - Computer Engineering
Supervisors
Examiners
Available from: 2025-06-10 Created: 2025-06-09 Last updated: 2025-06-10Bibliographically approved

Open Access in DiVA

analys_av_strategier_for_lastbalanseringi_aktorsbaserade_mikrotjanster(2510 kB)67 downloads
File information
File name FULLTEXT01.pdfFile size 2510 kBChecksum SHA-512
5d2030f2dc7fa7effd273f46148e025c897f1ed3eed770cc5a21cc3024c29483ef694dc93c4c52de99555a6f1303c0618720f219b1a351fb6d748aa3d3d0e626
Type fulltextMimetype application/pdf

By organisation
Health Informatics and Logistics
Software Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 67 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 230 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf