How Does Microservice Granularity Impact Energy Consumption and Performance? A Controlled Experiment

๐Ÿ“… 2025-02-01
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
This study investigates the coupled impact of microservice granularity on software energy consumption and response latency, revealing how this relationship varies with system scale (Pet Clinic/Train Ticket) and load intensity (40โ€“400 req/s). Through controlled experiments, we construct coarse-, medium-, and fine-grained variants via microservice refactoring and perform joint energyโ€“latency measurements. This work is the first to quantitatively characterize the three-dimensional interaction among granularity, scale, and load. Results show that, in large-scale systems, fine-grained decomposition increases average energy consumption by 13% (+461 J) and latency by 14% (+5.2 ms) relative to medium granularity; a tenfold load increase raises energy consumption by 23% and latency by 98%. Based on these findings, we propose empirically grounded design guidelines for granularity trade-offs in green software engineering, supporting energy-efficient cloud-native system development.

Technology Category

Application Category

๐Ÿ“ Abstract
Context: Microservice architectures are a widely used software deployment approach, with benefits regarding flexibility and scalability. However, their impact on energy consumption is poorly understood, and often overlooked in favor of performance and other quality attributes (QAs). One understudied concept in this area is microservice granularity, i.e., over how many services the system functionality is distributed. Objective: We therefore aim to analyze the relationship between microservice granularity and two critical QAs in microservice-based systems: energy consumption and performance. Method: We conducted a controlled experiment using two open-source microservice-based systems of different scales: the small Pet Clinic system and the large Train Ticket system. For each system, we created three levels of granularity by merging or splitting services (coarse, medium, and fine) and then exposed them to five levels of request frequency. Results: Our findings revealed that: i) granularity significantly affected both energy consumption and response time, e.g., in the large system, fine granularity consumed on average 461 J more energy (13%) and added 5.2 ms to response time (14%) compared to coarse granularity; ii) higher request loads significantly increased both energy consumption and response times, with moving from 40 to 400 requests / s resulting in 651 J higher energy consumption (23%) and 41.2 ms longer response times (98%); iii) there is a complex relationship between granularity, system scale, energy consumption, and performance that warrants careful consideration in microservice design. We derive generalizable takeaways from our results. Conclusion: Microservices practitioners should take our findings into account when making granularity-related decisions, especially for large-scale systems.
Problem

Research questions and friction points this paper is trying to address.

Microservices Granularity
Energy Consumption
Response Time
Innovation

Methods, ideas, or system contributions that make the work stand out.

Microservices Granularity
Energy Consumption
Performance Indicators
๐Ÿ”Ž Similar Papers
No similar papers found.
Y
Yiming Zhao
Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
T
T. D. Matteis
Vrije Universiteit Amsterdam, Amsterdam, The Netherlands
Justus Bogner
Justus Bogner
Assistant Professor, Vrije Universiteit Amsterdam, S2 Group
empirical SEsoftware architecturesoftware sustainabilitySE4AImicroservices