I am load testing a t2.micro box that has nginx and postgrest running in docker containers. Nginx acts as a proxy in front of postgrest. If i go directly to the upstream (postgrest) i get a nice graph (peaks at about 900/rps) If i go through nginx, i get this kind of graph
The CPU is not maxed out (only about 50%)
This is the nginx config used. Everything that is commented has been tried with no impact. I also played with values of worker_connections and related things. What can this periodic drop be triggered by?
worker_processes 2; #worker_rlimit_nofile 2048; events { # multi_accept on; worker_connections 1024; use epoll; } http { resolver 127.0.0.11 ipv6=off; include mime.types; #tcp_nodelay off; #tcp_nopush on; upstream postgrest { server postgrest:3000; keepalive 64; } server { listen 80; server_name localhost; charset utf-8; location /rest/ { default_type application/json; #proxy_buffering off; proxy_pass http://postgrest/; # Reverse proxy to your PostgREST } } }