Skip to content

Commit

Permalink
final (#1680)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgdss committed Mar 11, 2024
1 parent e55e70b commit e9b0e7f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
10 changes: 5 additions & 5 deletions participantes/vgdss/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.5"
x-db-connection-settings: &db-connection-settings
CREBITO_DB__uri: "postgresql+asyncpg://user:password@127.0.0.1/crebito"
CREBITO_DB__pool_size: 10
CREBITO_DB__max_overflow: 5
CREBITO_DB__max_overflow: 10
CREBITO_DB__pool_timeout: 60
CREBITO_DB__pool_recycle: 1800
CREBITO_DB__echo: false
Expand All @@ -12,12 +12,12 @@ x-healthcheck-settings: &default-healthcheck
interval: 1s
timeout: 3s
retries: 5
start_period: 2s
start_period: 1s

services:
api1: &api
image: docker.io/vgdss/crebito:latest
pull_policy: always
#pull_policy: always
hostname: api1
container_name: rinha-api1
depends_on:
Expand Down Expand Up @@ -67,7 +67,7 @@ services:
deploy:
resources:
limits:
cpus: "0.2"
cpus: "0.1"
memory: "50MB"
healthcheck:
<<: *default-healthcheck
Expand All @@ -89,7 +89,7 @@ services:
deploy:
resources:
limits:
cpus: "0.4"
cpus: "0.5"
memory: "300MB"
healthcheck:
<<: *default-healthcheck
Expand Down
22 changes: 12 additions & 10 deletions participantes/vgdss/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ events {
worker_connections 1024; # Reduzido de 1024 para economizar memória, já que a carga é de ~251 req/s.
use epoll;
accept_mutex off; # set to 'on' if nginx worker_processes > 1
multi_accept on;
}

http {
Expand All @@ -19,33 +20,34 @@ http {
tcp_nopush off; # Desativar, pois não estamos preocupados com otimização de cabeçalhos.
tcp_nodelay on; # Manter ativado para enviar respostas HTTP rapidamente.

keepalive_requests 5000;
keepalive_requests 1000;
keepalive_timeout 120;

proxy_connect_timeout 75s;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

upstream api {
server 127.0.0.1:8001; # API 1
server 127.0.0.1:8002; # API 2
keepalive 8;
keepalive 32;
}

server {
listen 9999;

server_tokens off;
client_max_body_size 20M;
#server_tokens off;
#client_max_body_size 20M;

location / {
proxy_pass http://api;
proxy_ignore_client_abort on;
proxy_connect_timeout 65s;
proxy_read_timeout 65s;
proxy_send_timeout 65s;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
#proxy_ignore_client_abort on;
#proxy_connect_timeout 65s;
#proxy_read_timeout 65s;
#proxy_send_timeout 65s;
#proxy_redirect off;
#proxy_buffering off;
}
}
}
4 changes: 2 additions & 2 deletions participantes/vgdss/postgresql.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
listen_addresses='*'
max_connections = 40
max_connections = 100

# Configurações de Log
log_destination = 'stderr'
Expand All @@ -12,4 +12,4 @@ log_duration=off
log_lock_waits=off
log_error_verbosity=terse

shared_buffers = 80MB
shared_buffers = 75MB

0 comments on commit e9b0e7f

Please sign in to comment.