I have a simple nginx tcp load balancer that simply passes connections to the web servers. The requests per second is lower using the load balancer with 2 servers than one of those servers by itself. The load balancer also doesn’t increase its requests per second when adding additional web servers… This doesn’t seem right. Any ideas what could be causing this?
# loads stream module
load_module /usr/lib/nginx/modules/ngx_stream_module.so;
# sets user to default user for web server
user www-data;
# sets number of cpu cores to use
worker_processes auto;
# customizes how to handle connections
events {
# sets number of connections to use per cpu core
worker_connections 1024;
# uses efficient connection processing method
use epoll;
# sets worker processes to accept all connections
multi_accept on;
}
# customizes how to handle incoming tcp connections
stream {
# distributes secure connections between specified web servers
upstream web_servers_insecure {
# sets ip address and port of web servers
server 147.182.205.7:80;
#server 128.199.3.255:80;
}
# customizes how to handle insecure connections
server {
# sets port
listen 80;
# sends tcp connections to upstream directive
proxy_pass web_servers_insecure;
}
# distributes secure connections between specified web servers
upstream web_servers_secure {
# sets ip address and port of web servers
server 147.182.205.7:443;
#server 128.199.3.255:443;
}
# customizes how to handle secure connections
server {
# sets port
listen 443;
# sends connections to upstream directive
proxy_pass web_servers_secure;
}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I might be wrong but this is to be expected. When you get the request on your Droplet, the Load Balancer one, it needs to take the request and forward it to the proper Droplet. This action takes some time, even if it should be one millisecond or whatever. Again I might be wrong but this is my take on it.
I’m interested to see other answers if there is a real solution to it.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.