AWS- How to estimate a server configuration for nginx load balancer?
-
What kind of parameters can be used to estimate how much memory and the number of CPU cores are required for a load balancer?
I have a requirement to setup LB based on Nginx to route the traffic to other nodes via TCP/IP as on other nodes that have PHP-FPM installed. SSL will terminate at Nginx and traffic to nodes is to be based on just HTTP. Max timeout to be five minutes.I am unable to understand how many requests this Nginx LB can swiftly serve while running on a c6gn.medium (1vCPU,2GB Memory, network bandwidth up to 25GBPS) which is CPU optimized and a t4g.medium which is a burstable instance having 2 vCPU and 4GB memory. Cheers!
-
There are 2 ways I can think of to solve this problem:
You can use your own data points from your own experience or others: One datapoint I can provide is ~70,000 sessions per month, probably 50 connections per page request, 1MB page size and maybe 1.5-2 pages per session was running on Nginx 1.14 on a t3.medium. I don't recall ever getting charged for CPU credits, so the CPU usage can't have been ever above 20% over 24h. I do recall upgrading from t3.small at some point, so it must have been memory usage. ~200 vhosts and their TLS certificates.
You can use Route53 weighted routing and distribute the traffic to say a c6gn.xlarge (to be super save) and a t4g.medium and then slowly dial up the percentages and watch CPU, memory, network and disk throughput until you notice bottlenecks.