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

viniciusfcf 99% #33

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion participantes/viniciusfcf/.mvn/wrapper/.gitignore

This file was deleted.

98 changes: 0 additions & 98 deletions participantes/viniciusfcf/.mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

18 changes: 0 additions & 18 deletions participantes/viniciusfcf/.mvn/wrapper/maven-wrapper.properties

This file was deleted.

24 changes: 24 additions & 0 deletions participantes/viniciusfcf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@ Repositório: [https://github.com/viniciusfcf/rinha-de-backend-2024-q1/](https:/
- Quarkus 🚀
- Postgres
- Nginx

### COmo subir
- Executar: `docker compose down`

### Como apagar os rastros dos containers
- Após cada execução, é necessário chamar `docker compose down --volumes` para remove ro volume criado pelo Postgres

### O que esperar?
- Na minha máquina rodou 99%.
```
System:
Kernel: 5.15.0-92-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.6.8
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: Dell product: G3 3590 v: N/A serial: <superuser required> Chassis: type: 10
serial: <superuser required>
CPU:
Info: quad core model: Intel Core i5-9300H bits: 64 type: MT MCP arch: Coffee Lake rev: A cache:
L1: 256 KiB L2: 1024 KiB L3: 8 MiB
Speed (MHz): avg: 3848 high: 4000 min/max: 800/4100 cores: 1: 3700 2: 3700 3: 3844 4: 3816
5: 3865 6: 3860 7: 4000 8: 4000 bogomips: 38400

```
![alt text](image.png)
2 changes: 0 additions & 2 deletions participantes/viniciusfcf/build.sh

This file was deleted.

30 changes: 13 additions & 17 deletions participantes/viniciusfcf/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,30 @@ services:
# Lembre-se de que seu serviço HTTP deve estar hospedado num repositório
# publicamente acessível! Ex.: hub.docker.com
image: viniciusfcf/rinha-backend-2024q1:latest
hostname: api01
network_mode: "host"
network_mode: host
environment:
- QUARKUS_HTTP_PORT=8081
- QUARKUS_DATASOURCE_JDBC_MAX_SIZE=3
- QUARKUS_DATASOURCE_JDBC_MIN_SIZE=3
- QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE=3
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.25"
cpus: "0.4"
memory: "100MB"
ulimits:
nproc: 65535
nofile:
soft: 1000000
hard: 1000000

api02:
# Essa sintaxe reusa o que foi declarado em 'api01'.
<<: *api
hostname: api02
environment:
- QUARKUS_HTTP_PORT=8082

nginx:
image: nginx:latest
network_mode: "host"
network_mode: host
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
Expand All @@ -45,28 +41,28 @@ services:
memory: "50MB"

db:
image: postgres:latest
hostname: db
image: postgres:16.1
command: postgres -c 'max_connections=15' -c 'fsync=off' -c 'synchronous_commit=off' -c 'checkpoint_timeout=1d' -c 'full_page_writes=false'
environment:
- POSTGRES_PASSWORD=123
- POSTGRES_USER=admin
- POSTGRES_DB=rinha
command: postgres -c 'max_connections=30'
network_mode: "host"
network_mode: host
volumes:
- ./import.sql:/docker-entrypoint-initdb.d/script.sql
- ./postgres-data:/var/lib/postgresql/data
deploy:
resources:
limits:
# Note que a soma de todos os limites dos serviços
# aqui declarados é de 1.5 unidades de CPU e 550MB
# de memória. A distribuição feita aqui é apenas
# um exemplo – distribua como quiser.
cpus: "0.8"
memory: "100MB"
cpus: "0.5"
memory: "150MB"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
interval: 10s
timeout: 5s
retries: 20
start_period: 10s
Expand Down
Loading