diff --git a/participantes/vgdss/docker-compose.yml b/participantes/vgdss/docker-compose.yml index ef6ccf27e..a4bf44b61 100644 --- a/participantes/vgdss/docker-compose.yml +++ b/participantes/vgdss/docker-compose.yml @@ -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 @@ -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: @@ -67,7 +67,7 @@ services: deploy: resources: limits: - cpus: "0.2" + cpus: "0.1" memory: "50MB" healthcheck: <<: *default-healthcheck @@ -89,7 +89,7 @@ services: deploy: resources: limits: - cpus: "0.4" + cpus: "0.5" memory: "300MB" healthcheck: <<: *default-healthcheck diff --git a/participantes/vgdss/nginx.conf b/participantes/vgdss/nginx.conf index b3703fb14..07222c288 100644 --- a/participantes/vgdss/nginx.conf +++ b/participantes/vgdss/nginx.conf @@ -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 { @@ -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; } } } diff --git a/participantes/vgdss/postgresql.conf b/participantes/vgdss/postgresql.conf index 0396fe646..02ccc7cfd 100644 --- a/participantes/vgdss/postgresql.conf +++ b/participantes/vgdss/postgresql.conf @@ -1,5 +1,5 @@ listen_addresses='*' -max_connections = 40 +max_connections = 100 # Configurações de Log log_destination = 'stderr' @@ -12,4 +12,4 @@ log_duration=off log_lock_waits=off log_error_verbosity=terse -shared_buffers = 80MB +shared_buffers = 75MB