Cloud computing has gained widespread recognition for facilitating myriad online services and applications. However, the current stages of commercial cloud computing employ a moderate design, wherein computational resources like storage and servers are housed in a few sizable worldwide data centers. System reliability, efficiency, and low latency are all goals of virtual machine (VM) placement. Load balancing has emerged as a crucial challenge for attaining energy efficiency in a fictitious grid computing architecture where a variety of users’ workloads are distributed across several virtual machines. We propose a more effective optimization technique known as the twin fold moth flame algorithm. This algorithm considers multiple constraints, including computation time, stability, and placement cost. The proposed model’s effectiveness will be evaluated based on relocation costs, reaction times, and stability assessments. The most significant gains of the presented work are 4.24%, 9.73%, 11.10%, 28.83%, 7.63%, and 10.62% for 20 count data of nodes for artificial bee colony–bat algorithm, ant colony optimization, crow search algorithm, krill herd, whale optimization genetic algorithm, and improved Lévy-based whale optimization algorithm, respectively.