Abstract
Context: Infrastructure as code (IaC) is the practice of automatically configuring, managing, and provisioning an organization's infrastructure using configuration scripts, e.g., Ansible scripts. While IaC is beneficial for automated software deployment and configuration management, the relationship between certain configuration patterns and performance attributes, such as execution time remain unknown. Configuration patterns are recurring coding patterns in configuration scripts that are used in IaC. A systematic evaluation can quantify the relationship between configuration patterns and performance attributes, which in turn can aid practitioners in their configuration script development process.Objective: The objective of the paper is to help practitioners in obtaining desired performance for IaC-based infrastructure management by deriving a set of configuration patterns that correlate with execution time, CPU consumption, and memory consumption.Methods: We conduct an empirical study with 4,523 and 64 Ansible configuration scripts, collected from open source software (OSS) and proprietary repositories, respectively. We first derive potential configuration patterns related to performance from peer-reviewed publications and grey literature. We execute the collected configuration scripts, collect performance data, and perform statistical analysis to identify the patterns related to performance. Additionally, we develop a linter called PERFector to detect these patterns in configuration scripts.Results: We derive a list of 5 performance-related patterns. Using PERFector we identify 1,873 instances of performance related patterns, where the pattern `needless facts' is the most frequent category. We obtain practitioner feedback for 48 instances of patterns, of which 19 instances have been confirmed as valid.Conclusion: Our paper provides a list of performance-related configuration patterns that practitioners can detect using PERFector and avoid. This provides a solid foundation for future research on techniques to automatically repair performance-related configuration patterns.

This publication has 30 references indexed in Scilit: