<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kunal Sharma on Medium]]></title>
        <description><![CDATA[Stories by Kunal Sharma on Medium]]></description>
        <link>https://medium.com/@kunalsharma1221?source=rss-a8ecf4759b6e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_1Qx4zRVsQYg7TyX.</url>
            <title>Stories by Kunal Sharma on Medium</title>
            <link>https://medium.com/@kunalsharma1221?source=rss-a8ecf4759b6e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:41:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kunalsharma1221/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How did Performance Testing help us to find bottlenecks in microservices?]]></title>
            <link>https://medium.com/@kunalsharma1221/how-did-performance-testing-help-us-to-find-bottlenecks-in-microservices-ca34c4ac7f43?source=rss-a8ecf4759b6e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca34c4ac7f43</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Kunal Sharma]]></dc:creator>
            <pubDate>Mon, 04 May 2020 11:09:18 GMT</pubDate>
            <atom:updated>2020-05-04T11:34:45.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*3Ok0tnlin_Uh0kCDEnKa_g.png" /></figure><h3>How Performance is defined?</h3><p>If we talk about performance there are three dimensions on which any service’s performance is dependent namely</p><ol><li><strong>Speed</strong><br>a. API<br>b. Database<br>c. Cache<br>d. Inter-Service Communications<br>e. Others</li><li><strong>Scalability</strong><br>a. EBS or Kubernetes<br>b. Database<br>c. Others</li><li><strong>Stability</strong><br>a. Load<br>b. Stress<br>c. Endurance<br>d. Spike<br>e. Others</li></ol><p>Above three dimensions must go together. For instance, Speed can not be achieved without Scalability and Stability.</p><blockquote><strong>Major Challenge</strong></blockquote><p>It lies in the nature of applications. For example</p><ol><li><strong>BFF/Facade layer</strong> is stateless, ideally, it doesn’t need a database but heavily dependent upon cache and perfect tuning of TTL (time to live). Caching and Inter-Service messaging needs to be optimised.</li><li><strong>Other Services </strong>like Ordering or Payment service, they heavily depend on the database(huge DB size) or API communication(be it third party or internal).</li></ol><p>So, all services have their own way of operating and behaving. The only way to find performance is to allow all service to go through stability stage (Stress, Load, Endurance testing).</p><blockquote><a href="https://gettaurus.org/"><strong>Blazemeter: Taurus</strong></a></blockquote><p>We found some good open-source frameworks for performance testing and decided to go ahead with Taurus for its ease of use with CI/CD pipeline. It’s a wrapper over Jmeter, but with advance reporting abilities and automation-friendly conveniences.</p><h3>Automate Performance Testing With Jenkins</h3><p>For the scale of 100s of microservices, we’re running in our organization and given the scenario that we want to make our new tool adoption convenient and scalable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*24ENJXeTBq90MLGPgR8-4Q.png" /><figcaption>Jenkins Pipeline and checks before service deployment</figcaption></figure><p>Our next missing piece of the puzzle was: “How to fit the Taurus in our workflow”. For that, we integrate Taurus on our <strong>Pre-Prod</strong> environment with Jenkins CD pipeline (which deploys services on Kubernetes managed clusters). Pre-Prod is a replica of the Prod environment, having the same configuration of resources like Production, where we test our services integration or stability before rolling out for the public.</p><blockquote><strong>Taurus Integration with Docker</strong></blockquote><p>Taurus needs the configuration of APIs to run the performance tests on and their Pass/Fail criteria. We had to provide these configurations for every service we plan to take onboard. And for that we updated our existing Jenkins script, which fetches — build— deploy the code on K8s, to extend with the functionality of building a docker image of <a href="https://hub.docker.com/r/blazemeter/taurus/">Taurus</a> and run the performance cases before deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dI1nR-nEfHQNzL9iyNy3KQ.png" /><figcaption>Taurus image building flow with docker</figcaption></figure><blockquote><strong>Testing Scenario for Performance</strong></blockquote><p>Taurus supports multiple test scenarios like Response Time, Latency, Error Rate, CPU utilization and etc. We can assign the different criteria to all APIs we added for the Performance Test. And criteria could be as simple as, let’s say, if average RT goes over 100ms for 7s for 100 concurrent requests, then the test should fail. Or when the error rate is &gt; 2% for 10s, then the test should fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtOT4c3AslyQYhf1cCSopQ.png" /><figcaption>Fail Taurus test for a scenario</figcaption></figure><p>Jenkins will Pass or Fail the build, and send the alerts to the code owner along with an analysis report. Automating these performance tests and running them frequently for the services helped us to expose scenarios where the application will not perform at the expected level in the real world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AjkfaxZH17jxeEm-VA6Q-g.png" /><figcaption>Load vs RT analysis for one such service (0 to 50 concurrent requests)</figcaption></figure><blockquote><strong>Identify Performance bottlenecks</strong></blockquote><p>Taurus reports helped us to identify RESTful API calls which will perform poorly if there is a sudden spike in real-time traffic during sale events.</p><p>This enabled us, developers, to dig into those low performing APIs and identify the bottlenecks. We optimized the hundreds of line of code, implement the cache mechanisms wherever required, move multiple API calls to Bulk API calls, tweak database queries and so on.</p><p>We could clearly see significant improvements in the same test case scenario when running again.</p><h3>Verdict</h3><p>When you’re sleeping at home at night and suddenly, in between sleep you get a call about the server crashing, because there is a sale going on your product, at some other part of the globe, trust me, you don’t want to end up in those nerve-racking situations very often.</p><p>Performance testing is a really important aspect of software shipment. It really makes the product resilient to the spikes in traffic and makes the whole user experience delightful. And if the customers are happy with the product, business is happy.</p><h3>Epilogue</h3><p>It’s a win-win for all of us, both customers or stakeholders of the product. The customers will get value for money services, and we, stakeholder, will learn how to tune ourselves to think in term of scale and usability and improve.</p><p><em>Give it a shot and try to set up your own Performance testing environment for your services, and let me know in the comment, how performance tuning has helped you and your business to evolve.</em></p><p>I’d also like to thanks to my Manager and Teammates for working suggestions and insightful inputs in this project.</p><p>So, until next time, when we will meet to ‘search’ our lost sleep in the documents of ElasticSearch queries, till then KEEP LEARNING<em>. :)</em></p><h3>References</h3><p><a href="https://gettaurus.org/kb/Basic1/">Learning Taurus</a></p><p><a href="https://dzone.com/articles/running-your-load-tests-with-pass-fail-criteria-a">https://dzone.com/articles/running-your-load-tests-with-pass-fail-criteria-a</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca34c4ac7f43" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>