Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR final #1646

Merged
merged 10 commits into from
Mar 11, 2024
Prev Previous commit
Next Next commit
Updating the docker-compose and nginx.conf
Signed-off-by: Guilherme Mafra da Costa <g.mafra.costa@gmail.com>
  • Loading branch information
gmafrac committed Mar 10, 2024
commit 6a7da5c0a357479bef668d1ec6399f02b7453545
28 changes: 14 additions & 14 deletions participantes/gmafrac-golang/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
version: "3"

services:
db:
image: postgres:16.1
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: crebito
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c full_page_writes=0
deploy:
resources:
limits:
cpus: "0.65"
memory: "400MB"

api1: &api
image: gmafrac/rinha-api:latest
Expand All @@ -17,20 +31,6 @@ services:
api2:
<<: *api

db:
image: postgres:16.1
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: crebito
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c full_page_writes=0
deploy:
resources:
limits:
cpus: "0.65"
memory: "400MB"

nginx:
image: nginx:latest
Expand Down
10 changes: 9 additions & 1 deletion participantes/gmafrac-golang/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ events {
}

http {
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
access_log off;
sendfile on;

client_body_timeout 10;
send_timeout 2;
keepalive_timeout 30;
keepalive_requests 100000;

upstream api {
server api1:8080;
server api2:8080;
Expand Down