Load time of hitting cache server (nginx/squid) is greater than hitting Glassfish directly when I load test with upto 10,000 users on jmeter. Why? - caching

I'm hosting a web service on Glassfish which will probably get hit a million times a day so I thought of having a cache server (reverse proxy) to reduce the load on Glassfish.
I tried implementing them and load tested
directly on glassfish,
with nginx,
with squid.
The results was not as I expected. the average load time for 10000 users for GF, Nginx and Squid was 168ms, 245ms and 198ms - reverse of what I thought it would be.
The response contains cache control headers and it is a HIT each time it hits nginx or squid as can be seen from the access logs.

Related

High response time for HTTPS requests on Elastic Beanstalk

I am currently hosting a Laravel project on Elastic Beanstalk. The issue is that requests made over HTTPS are experiencing much slower response times (average of 5 seconds). I have ruled out internet issues and the CPU/RAM utilization of the server is not fully utilized. Additionally, php-fpm (with nginx) is correctly configured with 16 pools on each instance (t3.small).
The problem seems to be with Axios (XHR request) but sometimes other HTML pages also experience the same issue. You can test this yourself by visiting https://laafisoft.bf (open the developer tools to check the response time). The configuration that I am using for the Load Balancer can be found in the image below. The certificate that I am using for HTTPS is issued by AWS Certificate Manager (RSA 2048).
When testing, I also noticed that requests over HTTP (port 80) were much faster (average of 200ms), but after some time the response time for HTTP requests increased to the same level as HTTPS requests. I am confident that the issue is not related to my Laravel application or a database problem. For comparison, I have the same version of the website hosted on DigitalOcean without a Load Balancer and it has much faster response times (https://demo.laafisoft.bf).
Any help is welcome, I'm new to AWS so maybe I'm missing something.

What are some reasons migrating a site to Cloudflare could cause an increase in the number of active connections to a load balancer?

I use an application load balancer (AWS EC2 instance) to manage traffic to my site. I recently changed CDNs to Cloudflare. With my previous CDN, I observed an average of about 80 active connections per hour to the load balancer. After switching to Cloudflare, I now observe an average of 800-1200 active connections per hour.
The load balancer is using keep-alive connections with an idle timeout of 60 seconds. The difference in PoPs between Cloudflare and the legacy CDN is too small to account for such a large difference in connection count. I'm not sure what else I might be missing. Any pointers as to the source of this connection increase would be much appreciated. Thanks!

Google Cloud Platform - load balancer websocket keep disconnecting after few seconds

We are using 2 servers and have setup load balancer to redirect the trafic. Both servers are Compute engines.
We are also using websocket (socket.io) to keep the connection between users (online and offline status). When connection is established between users, it gets disconnected after few seconds. We concluded that it is load balancer configuration issue as if we use single server (without load balancer), connection remains alive until user goes offline.
We need help here if we need to do anything extra in load balancer configurations to work it smoothly with websocket.
Using ip addresses, not domain name (if that makes any difference)

If the number of requests are huge, can load balancer cause the issue while sending responses to respective clients?

I do have architecture of a Load balancer followed by two Web Application server and Database, I am hitting thousands of HTTP requests to the server from Jmeter distributed testing environment.
At the time of getting response back, few request does not get response back from the server.
I checked Database logs, 100 % requests were responded.
Checked with Web Application servers access logs, 100 % requests were responded.
Can Load balancer cause the damage traversing these pending responses to the respective clients?
Every time different different request are getting stuck.
Thanks in Advance!!
If you suspect load balancer, look at 3 typical causes first:
Server takes longer to respond than load balancer is waiting
Client has shorter timeout than it takes for server to respond.
Port/thread/connection exhaustion on load balancer, or other LB configuration problems
In all three cases, I suggest looking at the load balancer logs. Since you didn't specify which LB you are using, I cannot say exactly how the log looks, but typically LB log gives you option to see:
How long it took for a request to be sent to a web server and for the response from the web server to return to load balancer. You can them compare those numbers to timeouts configured for load balancer and the client (problem 1 and 2).
How long it took for a request from the client to be processed by LB and how long LB took to respond to a client. If it takes long, then something is not right with load balancer (problem 3)
And then of course if you have any errors on load balancer, they may just explain what's going on.
If you cannot review logs for load balancer, I suggest changing your JMeter test temporarily to target servers behind load balancer directly. You can even configure your script to evenly distribute load between all servers (for example by using multiple thread groups). That would allow you to isolate the problem, and get more information on what's going on.

nginx slow response after 500 users online

I have a file download site, where I use nginx to deliver the files and apache for web part.
However as soon as I hit around 500 users online and 1500Mbit/s, Nginx responses get delayed with 10 to 60 seconds. Once connection established everything works as expected.
Apache have no issues on browse side, HDDs are only 50% util, IOwait is 3, bandwidth is 70% saturated, CPU is 5%. I really don't understand why is this happening, I get no errors in nginx logs.

Resources