微服务粒度如何影响能耗和性能?一项受控实验
How Does Microservice Granularity Impact Energy Consumption and Performance? A Controlled Experiment
AI总结:
本文通过受控实验研究微服务粒度对能耗和性能的影响,发现粒度显著影响能耗和响应时间,且高负载进一步加剧能耗和响应时间,强调在微服务设计中需谨慎考虑粒度与系统规模的关系。
摘要:
背景:微服务架构是一种广泛应用的软件部署方法,具有灵活性和可扩展性的优势。然而,其对能耗的影响尚不明确,通常被性能和其他质量属性(QAs)所忽视。在这一领域,一个研究较少的概念是微服务粒度,即系统功能如何分布在多个服务中。目标:因此,我们旨在分析微服务架构中粒度与两个关键质量属性(QAs)之间的关系:能耗和性能。方法:我们使用两个不同规模的开源微服务系统进行了受控实验:小型的Pet Clinic系统和大型的Train Ticket系统。对于每个系统,我们通过合并或拆分服务创建了三个粒度级别(粗粒度、中粒度和细粒度),然后将它们暴露在五个级别的请求频率下。结果:我们的发现表明:i)粒度显著影响能耗和响应时间,例如在大型系统中,细粒度比粗粒度平均多消耗461焦耳(13%)的能耗,并使响应时间增加5.2毫秒(14%);ii)更高的请求负载显著增加了能耗和响应时间,从40到400请求/秒的转换导致能耗增加651焦耳(23%)和响应时间增加41.2毫秒(98%);iii)粒度、系统规模、能耗和性能之间存在复杂的相互关系,这在微服务设计中需要仔细考虑。我们从结果中推导出具有普遍性的结论。结论:微服务从业者在做出粒度相关决策时应考虑我们的发现,特别是对于大规模系统。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。