Why I replace AWS Elastic Load Balancer to HAProxy Load Balancer ?
I have been getting request from our API users to increase API response speed and decrease API response time. One of the reasons of slow response time was response data size. I was working on healthcare APIs which contains lots of data so the response data size was big. To reduce data size our API users were calling APIs with
Accept-Encoding: gzip, deflate but response was never return with compression( response header should contain
Content-Encoding: gzip). As a result response time was not improved.
Even though I have enabled our all web servers for accept encoding, API response did not return in compressed format. I have followed all steps for compression on server. What was wrong ?
As you can see API request was hitting AWS ELB with ‘accept-encoding’ header but response was not compressed
I thought there might be an issue with server 1 / server 2 and it was not returning compressed response, so I removed server 1 and server 2 in separate steps.
But still response was not compressed. To make it simple , i removed AWS ELB .
See above, response was compressed and it was returning data in compressed format with ‘gzip’ as a header.
Confirmed there was an issue with AWS ELB .
Then we have replaced it with HAProxy load balancer. HAProxy allows you to do lot of customization on network level and you can redirect your API endpoints based on conditions.
Compression is working fine in HAProxy
There may be work around AWS ELB and make it enable to compress the content. I have tried but was not able find it.
If you have any ideas , comments please let me know in comment section