Backend, Docker, Open Source

Proxy server for scaling traffic on demand for dynamically built hosts.

Our solution

The goal of the project is to create a tool that helps scaling the web traffic for dynamically emerging hosts (web servers).

In Ermlab, while creating scalable solutions for our customers and for ourselves (PLON site), we had repeatedly encountered the problem of building dynamic web applications. When a user requests from us to build a website rapidly, it usually requires reconfiguring and restarting the load balancer so that the new site could be visible on the internet. This causes the service to temporarily stop working and consequently stops other web applications. The solution that we had prepared allows, without reconfiguration and restart, to dynamically add new websites that are immediately visible to internet users.

Our solution made it possible to:

  • eliminate the restart of the load balancer
  • automate the process of adding new dynamic websites
  • increase the number of managed requests from the customers more than three times in comparison with competitive Hipache service
  • reduce response time and website load time by four times in comparison with competitive Hipache service

Technology

From a technological point of view, when creating a scalable proxy, we used:

  • Nginx server as the base proxy server
  • Nginx extension to use the Lua language while processing the request
  • Redis – scalable and efficient non-relational database
  • Docker – used to pack the whole solution into an easy-to-install package

 

In Ermlab, we follow the philosophy of sharing our solutions (see our Ermlab OpenSource projects), hence the Nginx-Lua-Proxy is available for free at github.com; you can also find the whole documentation there.

 

Performance tests

Our tests with the use of Apache Benchmark software indicate that the solution we developed is much more efficient than the competitive proxy server – Hipache. This is illustrated in the table below:

 

Parametr hipache nginx-lua-proxy
Concurrency Level: 200 200
Time taken for tests: 57.446 sekund 14.951 sekund
Complete requests: 20000 20000
Failed requests: 0 0
Write errors: 0 0
Total transferred: 6500000 bytes 6380000 bytes
HTML transferred: 2680000 bytes 2560000 bytes
Requests per second: 348.15 [#/sec] (mean) 1337.68 [#/sec] (mean)
Time per request: 348.464 ms 149.513 ms
Time per request: 2.872 [ms] 0.748 [ms]
Transfer rate: 110.50 [Kbytes/sec] 416.65 [Kbytes/sec]