
Serverless Java: Cold Start Mitigation in Cloud Run/Spring Boot
Sandeep Reddy Gundla , Lead Software Engineer, MACYS Inc, GA, USAAbstract
This paper focuses on the cold start latency problem in serverless Java applications, seen mainly when deploying with Google Cloud Run and Spring Boot. Auto-scaling, reduced infrastructure use, and cost savings are why serverless computing is becoming more popular. Still, Java applications generally face delays when starting up, referred to as cold starts, because the JVM must boot up, and Spring Boot comprises complex settings. Because of this latency, users' experience can become very poor, especially when using real-time APIs, chatbots, and e-commerce systems. The study explains the processes behind cold starts, their impact, and several ways to address them. Cloud Run's usage of containers and Spring Boot being a good choice for creating microservices is covered, as well as their difficulties in initializing quickly. Optimizations include adjusting container images, native compilation using GraalVM, setting "minimum instances" and concurrency in Cloud Run, using lazy initialization in Spring Boot, and routinely pinging during warm-up. These approaches have been observed to improve latency from several seconds to almost nothing whenever they are used. This research uses case analysis, benchmarking, and performance monitoring to examine the effectiveness of mitigation strategies. The paper concludes that although Java encounters some cold start difficulties, recent advancements in tools such as GraalVM, virtual machine design, and better cloud support are promising. If Java is configured correctly and sufficient time is spent planning, it can be an excellent fit for serverless environments on Google Cloud Run.
Keywords
Cold Start Latency, Serverless Java, Google Cloud Run, Spring Boot, GraalVM, Native Image
References
Abbott, R. J. (1990). Resourceful systems for fault tolerance, reliability, and safety. ACM Computing Surveys (CSUR), 22(1), 35-68.
Al-Maamari, T. A. A. (2016). Aspects of event-driven cloud-native application development (Master's thesis).
Bhattacharjee, R. (2009). An analysis of the cloud computing platform (Doctoral dissertation, Massachusetts Institute Of Technology).
Chavan, A. (2022). Importance of identifying and establishing context boundaries while migrating from monolith to microservices. Journal of Engineering and Applied Sciences Technology, 4, E168. http://doi.org/10.47363/JEAST/2022(4)E168
Chavan, A. (2024). Fault-tolerant event-driven systems: Techniques and best practices. Journal of Engineering and Applied Sciences Technology, 6, E167. https://doi.org/10.47363/JEAST/2024(6)E167
Chavan, A., & Romanov, Y. (2023). Managing scalability and cost in microservices architecture: Balancing infinite scalability with financial constraints. Journal of Artificial Intelligence & Cloud Computing, 5, E102. https://doi.org/10.47363/JMHC/2023(5)E102
Christudas, B. (2019). Practical microservices architectural patterns: event-based java microservices with spring boot and spring cloud. Apress.
Crescenzi, A., Kelly, D., & Azzopardi, L. (2016, March). Impacts of time constraints and system delays on user experience. In Proceedings of the 2016 acm on conference on human information interaction and retrieval (pp. 141-150).
Dhanagari, M. R. (2024). MongoDB and data consistency: Bridging the gap between performance and reliability. Journal of Computer Science and Technology Studies, 6(2), 183-198. https://doi.org/10.32996/jcsts.2024.6.2.21
Fox, A., Griffith, R., Joseph, A., Katz, R., Konwinski, A., Lee, G., ... & Stoica, I. (2009). Above the clouds: A berkeley view of cloud computing. Dept. Electrical Eng. and Comput. Sciences, University of California, Berkeley, Rep. UCB/EECS, 28(13), 2009.
Fumero, J. J., Remmelg, T., Steuwer, M., & Dubach, C. (2015). Runtime code generation and data management for heterogeneous computing in java. In Proceedings of the principles and practices of programming on the java platform (pp. 16-26).
Golec, M., Walia, G. K., Kumar, M., Cuadrado, F., Gill, S. S., & Uhlig, S. (2024). Cold start latency in serverless computing: A systematic review, taxonomy, and future directions. ACM Computing Surveys, 57(3), 1-36.
Heydari Beni, E. (2021). Deployment Efficiency and Data Security for the Cloud.
Jandl, A. (2020). IoT and edge computing technologies for vertical farming from seed to harvesting (Doctoral dissertation, Wien).
Jani, Y. (2020). Spring boot for microservices: Patterns, challenges, and best practices. European Journal of Advances in Engineering and Technology, 7(7), 73-78.
Joosen, A., Hassan, A., Asenov, M., Singh, R., Darlow, L., Wang, J., & Barker, A. (2023, October). How does it function? characterizing long-term trends in production serverless workloads. In Proceedings of the 2023 ACM Symposium on Cloud Computing (pp. 443-458).
Khatiwada, P., & Dhakal, P. (2024). Evaluating Serverless Machine Learning Performance on Google Cloud Run. arXiv preprint arXiv:2406.16250.
Konneru, N. M. K. (2021). Integrating security into CI/CD pipelines: A DevSecOps approach with SAST, DAST, and SCA tools. International Journal of Science and Research Archive. https://ijsra.net/content/role-notification-scheduling-improving-patient
Kumar, A. (2019). The convergence of predictive analytics in driving business intelligence and enhancing DevOps efficiency. International Journal of Computational Engineering and Management, 6(6), 118-142. https://ijcem.in/wp-content/uploads/THE-CONVERGENCE-OF-PREDICTIVE-ANALYTICS-IN-DRIVING-BUSINESS-INTELLIGENCE-AND-ENHANCING-DEVOPS-EFFICIENCY.pdf
Larsson, M. (2023). Microservices with Spring Boot 3 and Spring Cloud: Build Resilient and Scalable Microservices Using Spring Cloud, Istio, and Kubernetes. Packt Publishing Ltd.
Lin, C., Nadi, S., & Khazaei, H. (2020, September). A large-scale data set and an empirical study of docker images hosted on docker hub. In 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME) (pp. 371-381). IEEE.
Manner, J., Endreß, M., Heckel, T., & Wirtz, G. (2018, December). Cold start influencing factors in function as a service. In 2018 IEEE/ACM International Conference on Utility and Cloud Computing Companion (UCC Companion) (pp. 181-188). IEEE.
Mouat, A. (2015). Using Docker: Developing and deploying software with containers. " O'Reilly Media, Inc.".
Nyati, S. (2018). Revolutionizing LTL carrier operations: A comprehensive analysis of an algorithm-driven pickup and delivery dispatching solution. International Journal of Science and Research (IJSR), 7(2), 1659-1666. https://www.ijsr.net/getabstract.php?paperid=SR24203183637
Pérez, A., Risco, S., Naranjo, D. M., Caballer, M., & Moltó, G. (2019, July). On-premises serverless computing for event-driven data processing applications. In 2019 IEEE 12th International conference on cloud computing (CLOUD) (pp. 414-421). IEEE
Reddy, K. S. P. (2017). Beginning Spring Boot 2: Applications and microservices with the Spring framework. Apress.
Sadakath, M. S. (2018). Spring Boot 2.0 Projects: Build production-grade reactive applications and microservices with Spring Boot. Packt Publishing Ltd.
Sardana, J. (2022). Scalable systems for healthcare communication: A design perspective. International Journal of Science and Research Archive. https://doi.org/10.30574/ijsra.2022.7.2.0253
Singh, V. (2022). Intelligent traffic systems with reinforcement learning: Using reinforcement learning to optimize traffic flow and reduce congestion. International Journal of Research in Information Technology and Computing. https://romanpub.com/ijaetv4-1-2022.php
Singh, V. (2022). Multimodal deep learning: Integrating text, vision, and sensor data: Developing models that can process and understand multiple data modalities simultaneously. International Journal of Research in Information Technology and Computing. https://romanpub.com/ijaetv4-1-2022.php
Villamizar, M., Garcés, O., Ochoa, L., Castro, H., Salamanca, L., Verano, M., ... & Lang, M. (2017). Cost comparison of running web applications in the cloud using monolithic, microservice, and AWS Lambda architectures. Service Oriented Computing and Applications, 11, 233-247.
Wen, J., Chen, Z., Liu, Y., Lou, Y., Ma, Y., Huang, G., ... & Liu, X. (2021, August). An empirical study on challenges of application development in serverless computing. In Proceedings of the 29th ACM joint meeting on European software engineering conference and symposium on the foundations of software engineering (pp. 416-428).
Wu, S., Mao, B., Lin, Y., & Jiang, H. (2017). Improving performance for flash-based storage systems through GC-aware cache management. IEEE Transactions on Parallel and Distributed Systems, 28(10), 2852-2865.
Wyld, D. C. (2009). Moving to the cloud: An introduction to cloud computing in government. IBM Center for the Business of Government.
Zhang, S., Zhang, S., Chen, X., & Wu, S. (2010, January). Analysis and research of cloud computing system instance. In 2010 second international conference on future networks (pp. 88-92). IEEE.
Article Statistics
Downloads
Copyright License
Copyright (c) 2025 Sandeep Reddy Gundla

This work is licensed under a Creative Commons Attribution 4.0 International License.