Optimizing AWS lambda code execution time in amazon web services


  • Muh Awal Arifin Universitas Muslim Indonesia
  • Ramdan Satra Universitas Muslim Indonesia
  • Lukman Syafie Universitas Muslim Indonesia
  • Ahmad Mursyidun Nidhom National University of Malaysia




Cloud computing, Serverless, AWS lambda, S3, DynamoDB, Amazon web services


One of the problems in providing infrastructure is the lack of interest in managing infrastructure. AWS Lambda is a FaaS (Function as a Service) service that allows users to run code automatically in an environment managed by Amazon Web Services. In this study, the method used is to collect data on code execution time at various input sizes, then perform an analysis of the factors that affect execution time. Furthermore, optimization is carried out by selecting the appropriate memory size and proper coding techniques to improve performance. The results show that optimizing memory size and coding can improve code execution time performance by up to 30%, depending on the type of service used. This can help AWS Lambda users improve code performance and save on operational costs.


L. Muller, C. Chrysoulas, N. Pitropakis, and P. J. Barclay, “A Traffic Analysis on Serverless Computing Based on the Example of a File Upload Stream on AWS Lambda,” Big Data Cogn. Comput., vol. 4, no. 4, p. 38, Dec. 2020, doi: 10.3390/bdcc4040038.

X. Niu, D. Kumanov, L.-H. Hung, W. Lloyd, and K. Y. Yeung, “Leveraging Serverless Computing to Improve Performance for Sequence Comparison,” in Proceedings of the 10th ACM International Conference on Bioinformatics, Computational Biology and Health Informatics, Sep. 2019, pp. 683–687, doi: 10.1145/3307339.3343465.

G. McGrath and P. R. Brenner, “Serverless Computing: Design, Implementation, and Performance,” in 2017 IEEE 37th International Conference on Distributed Computing Systems Workshops (ICDCSW), Jun. 2017, pp. 405–410, doi: 10.1109/ICDCSW.2017.36.

D. Jackson and G. Clynch, “An Investigation of the Impact of Language Runtime on the Performance and Cost of Serverless Functions,” in 2018 IEEE/ACM International Conference on Utility and Cloud Computing Companion (UCC Companion), Dec. 2018, pp. 154–160, doi: 10.1109/UCC-Companion.2018.00050.

M. Villamizar et al., “Infrastructure Cost Comparison of Running Web Applications in the Cloud Using AWS Lambda and Monolithic and Microservice Architectures,” in 2016 16th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGrid), May 2016, pp. 179–182, doi: 10.1109/CCGrid.2016.37.

W. Lloyd, S. Ramesh, S. Chinthalapati, L. Ly, and S. Pallickara, “Serverless Computing: An Investigation of Factors Influencing Microservice Performance,” in 2018 IEEE International Conference on Cloud Engineering (IC2E), Apr. 2018, pp. 159–169, doi: 10.1109/IC2E.2018.00039.

L. Feng, P. Kudva, D. Da Silva, and J. Hu, “Exploring Serverless Computing for Neural Network Training,” in 2018 IEEE 11th International Conference on Cloud Computing (CLOUD), Jul. 2018, vol. 2018-July, pp. 334–341, doi: 10.1109/CLOUD.2018.00049.

M. Sewak and S. Singh, “Winning in the Era of Serverless Computing and Function as a Service,” in 2018 3rd International Conference for Convergence in Technology (I2CT), Apr. 2018, pp. 1–5, doi: 10.1109/I2CT.2018.8529465.

T. Elgamal, A. Sandur, K. Nahrstedt, and G. Agha, “Costless: Optimizing Cost of Serverless Computing through Function Fusion and Placement,” in 2018 IEEE/ACM Symposium on Edge Computing (SEC), Oct. 2018, pp. 300–312, doi: 10.1109/SEC.2018.00029.

S. Quinn, R. Cordingly, and W. Lloyd, “Implications of Alternative Serverless Application Control Flow Methods,” in Proceedings of the Seventh International Workshop on Serverless Computing (WoSC7) 2021, Dec. 2021, vol. 6, pp. 17–22, doi: 10.1145/3493651.3493668.

P. Grzesik and D. Mrozek, “Serverless Nanopore Basecalling with AWS Lambda,” in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 12743 LNCS, Springer Science and Business Media Deutschland GmbH, 2021, pp. 578–586, doi: 10.1007/978-3-030-77964-1_44.

M. Villamizar et al., “Cost comparison of running web applications in the cloud using monolithic, microservice, and AWS Lambda architectures,” Serv. Oriented Comput. Appl., vol. 11, no. 2, pp. 233–247, Jun. 2017, doi: 10.1007/s11761-017-0208-y.

E. Rinta-Jaskari, C. Allen, T. Meghla, and D. Taibi, “Testing Approaches And Tools For AWS Lambda Serverless-Based Applications,” in 2022 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), Mar. 2022, pp. 686–692, doi: 10.1109/PerComWorkshops53856.2022.9767473.

J. Dantas, H. Khazaei, and M. Litoiu, “Application Deployment Strategies for Reducing the Cold Start Delay of AWS Lambda,” in 2022 IEEE 15th International Conference on Cloud Computing (CLOUD), Jul. 2022, vol. 2022-July, pp. 1–10, doi: 10.1109/CLOUD55607.2022.00016.

P. Jain, Y. Munjal, J. Gera, and P. Gupta, “Performance Analysis of Various Server Hosting Techniques,” Procedia Comput. Sci., vol. 173, pp. 70–77, Jan. 2020, doi: 10.1016/j.procs.2020.06.010.

A. Agache et al., “Firecracker: Lightweight virtualization for serverless applications - Amazon Science,” in Proceedings of the 17th USENIX Symposium on Networked Systems Design and Implementation (NSDI ’20), 2020, pp. 419–434, Accessed: Jan. 26, 2023. [Online]. Available: https://www.usenix.org/system/files/nsdi20-paper-agache.pdf.

W.-T. Lin et al., “Tracking Causal Order in AWS Lambda Applications,” in 2018 IEEE International Conference on Cloud Engineering (IC2E), Apr. 2018, pp. 50–60, doi: 10.1109/IC2E.2018.00027.

A. Pérez, G. Moltó, M. Caballer, and A. Calatrava, “Serverless computing for container-based architectures,” Futur. Gener. Comput. Syst., vol. 83, pp. 50–59, Jun. 2018, doi: 10.1016/j.future.2018.01.022.

H. Puripunpinyo and M. H. Samadzadeh, “Effect of optimizing Java deployment artifacts on AWS Lambda,” in 2017 IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS), May 2017, pp. 438–443, doi: 10.1109/INFCOMW.2017.8116416.

S. Dorodko and J. Spillner, “Selective Java code transformation into AWS Lambda functions,” CEUR Workshop Proc., vol. 2330, pp. 9–17, 2019, [Online]. Available: https://ceur-ws.org/Vol-2330/paper2.pdf.

M. Brantner, D. Florescu, D. Graf, D. Kossmann, and T. Kraska, “Building a database on S3,” in Proceedings of the 2008 ACM SIGMOD international conference on Management of data, Jun. 2008, pp. 251–264, doi: 10.1145/1376616.1376645.

X. Yu et al., “PushdownDB: Accelerating a DBMS Using S3 Computation,” in 2020 IEEE 36th International Conference on Data Engineering (ICDE), Apr. 2020, vol. 2020-April, pp. 1802–1805, doi: 10.1109/ICDE48307.2020.00174.

A. U. L, N. K. T, A. S. Jafar, S. N. S, and A. Professor, “The Research Study on DynamoDB-NoSQL Database Service,” Int. J. Comput. Sci. Mob. Comput., vol. 3, no. 10, pp. 268–279, 2014, [Online]. Available: https://d1wqtxts1xzle7.cloudfront.net/35162087/V3I10201487-.

Aishwarya Anand, “Managing Infrastructure in Amazon using EC2, CloudWatch, EBS, IAM and CloudFront,” Int. J. Eng. Res., vol. V6, no. 03, pp. 373–378, Mar. 2017, doi: 10.17577/IJERTV6IS030335.

M. Kiran, P. Murphy, I. Monga, J. Dugan, and S. S. Baveja, “Lambda architecture for cost-effective batch and speed big data processing,” in 2015 IEEE International Conference on Big Data (Big Data), Oct. 2015, pp. 2785–2792, doi: 10.1109/BigData.2015.7364082.

A. Mathew, V. Andrikopoulos, and F. J. Blaauw, “Exploring the cost and performance benefits of AWS step functions using a data processing pipeline,” in Proceedings of the 14th IEEE/ACM International Conference on Utility and Cloud Computing, Dec. 2021, pp. 1–10, doi: 10.1145/3468737.3494084.

A. Das, S. Patterson, and M. Wittie, “EdgeBench: Benchmarking Edge Computing Platforms,” in 2018 IEEE/ACM International Conference on Utility and Cloud Computing Companion (UCC Companion), Dec. 2018, pp. 175–180, doi: 10.1109/UCC-Companion.2018.00053.

T. E. Oliphant, “Python for Scientific Computing,” Comput. Sci. Eng., vol. 9, no. 3, pp. 10–20, May 2007, doi: 10.1109/MCSE.2007.58.

F. Zampetti, F. Belias, C. Zid, G. Antoniol, and M. Di Penta, “An Empirical Study on the Fault-Inducing Effect of Functional Constructs in Python,” in 2022 IEEE International Conference on Software Maintenance and Evolution (ICSME), Oct. 2022, pp. 47–58, doi: 10.1109/ICSME55016.2022.00013




How to Cite

Arifin, M. A., Satra, R., Syafie, L., & Nidhom , A. M. (2023). Optimizing AWS lambda code execution time in amazon web services. Bulletin of Social Informatics Theory and Application, 7(1), 14–23. https://doi.org/10.31763/businta.v7i1.609