International Research Journal of Engineering and Technology (IRJET)
e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022
p-ISSN: 2395-0072
www.irjet.net
Scale and Load Testing of Micro-Service Mohan M S1, Somesh Nandi2 Dept. Electronics and Communication Engineering, R.V College of Engineering, Banglore-560050 ---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - Representational State Transfer (REST)
maintained using various saga mechanism for multiple services which use same database.
Application Programming Interface (API) based micro services are more used in cloud applications development due to their inherent benefits. The advantages include scalability, independent development of micro-service. The designed system testing should be validated for functionality and load handling capability. Load testing framework was designed using the Locust framework. Developed framework could generate 2,000 requests per second per container initialized in 4 GB RAM system. This system was used to generate the load for a micro-service. The load was applied to the micro-service to test scaling features. For testing scale the application was deployed from 1 pod to N pod configuration. For each configuration load was applied and response for each configuration was analyzed and mapped. Testing on higher number RPS involved delayed response.
REST Architecture is based on web standards and uses HTTP Protocols. In REST everything is a resource and accessed through REST APIs [4]. Server does not maintain any state of the client. Client needs to maintain the state and based on its state, request is made to the appropriate API [5]. Resources in REST can be anything like JSON, HTML, text. Most used is the JSON response. These are the 4 commonly used HTTP methods. 1.GET – used to access resource, performs read-only operation. 2.POST – provides access to create resource. 3.DELETE – provides access to delete existing resource.
Key Words: REST, API, autoscaling, containerization
4.PUT – provides access to update or create a resource.
1.INTRODUCTION
3. SOFTWARE TOOLS
Web Platform for providing services and information is common for past decade. Every company wants to host its services online as internet has reached every corner of the world. Building a web platform would guarantee accessibility for every consumer. Designing of a Web Platform for a company to handle millions of customers requires latest technology, which can handle that much amount of load. Scaling a monolithic software application is difficult for large number of users. Hence developing application using microservice architecture ensures scalability [1], load balancing, faster deployment and lower troubleshooting times.
Development of framework for scale testing involves different software dependencies. Software used in this project are Pytest, Locust and Docker.
3.2.1 Pytest Pytest is python framework for writing functionality and unit tests for an application. It provides lot of customization using which we can achieve application specific test cases. Pytest provides fixtures using which common setup for each test case can be written. Fixtures can also be defined in various levels such as testcase-level, module-level and testrun-level. It also provides dependency decorators using which dependency between test cases can be implemented. The Pytest framework can be used to generate allure report for testcases easily. While running tests in module level all the files starting from python gets executed for pytest tests. For a file all the test function names starting from test or functions using pytest decorator are considered for tests. For writing test the function which needs to be tested should be called inside the test function and its output should be asserted with the expected output. After running the test, Pytest framework would show the list of failed tests with where it has failed. If a statement fails, it also mentions what is the expected assertion. A test can have multiple assert statements or check statements. If one of them fails then the entire test fails. Pytest’s debug options are very useful to debug it.
2. MICROSERVICE ARCHITECTURE Monolithic application were the predominant ones before arrival of micro-service based applications. Earlier an enterprise application was designed as a single software [2]. Monolithic applications gave rise to various issues such as scale problems and dependency between software development teams[3]. Since an enterprise application can be seen as integration between various components. Idea of developing these components/services separately was invented. Micro-service contains various components which are loosely coupled and independently scalable. The microservices would communicate between them using HTTP REST protocols such as AMQP. To achieve decoupling each service has separate databases. Consistency in the data is
© 2022, IRJET
|
Impact Factor value: 7.529
|
ISO 9001:2008 Certified Journal
|
Page 2629