A case study on the migration of Housing’s application servers

ankush maheshwari
Apr 11, 2020 · 5 min read

Internet and C10K problem, and the need for the concurrency

The Internet is a big place now. From 1996 to 2018, the number of users has significantly increased. Reason being that more and more businesses rely on digital products to engage their customers. The real estate market has not remained untouched from this wave of digital innovation too. Housing.com, being a leader in real estate markets’ digital product offerings, needs to consistently beef up its infrastructure in terms of scalable application servers, caching layer, and load balancers, etc. Since its infrastructure is hosted on AWS, we also need to ensure efficient(maximum CPU usage without hogging up the RAM) utilization of resources on the cloud while providing the hasslefree reliable user experience — supporting multiple concurrent client connections. With that intent in mind, we started evaluating the scalability parameters of our application servers — Unicorn and Puma.

Housing and Service-Oriented Architecture

A typical Webservice transaction in housing

Unicorn vs Puma

Both unicorn and puma are HTTP ruby application servers with a different model of concurrency.

Sleeping for 2 seconds

This test simulates requests with constant time IO work and as little CPU work as possible. As expected, Puma completely outperforms Unicorn.

Unicorn X4 -> 4 processes

Sleeping for 2 seconds + Rendering

An ideal IO-bound process with no CPU processing is not realistic. So we simulated some HTTP APIs that start with preparing for some data for rendering, then sleeping for 2 seconds, and finally rendering it. This simulation was more realistic to the real world HTTP endpoints. The performance trends are almost identical to the “sleep” test, but the throughput is a bit lower

Engineering @ Housing/Proptiger/Makaan

Engineering and technology articles from developers

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store