Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
181 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:18.12.1-alpine | ||
|
||
COPY . . | ||
RUN npm ci | ||
|
||
CMD ["node", "index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
- Batch | ||
- Split entre escrita e leitura? https://serverfault.com/questions/152745/nginx-proxy-by-request-method | ||
# Rinha BE 2023 - Q3 @luucaspole/@lukas8219 | ||
|
||
### Tecnologias usadas: | ||
|
||
- Node | ||
- Redis (vou meter ainda) | ||
- Postgres | ||
|
||
|
||
### Tática: | ||
Apenas fazer batch no client e rezar pro eventloop não morrer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
version: '3.4' | ||
services: | ||
postgres: | ||
image: postgres | ||
environment: | ||
POSTGRES_DB: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: 12345678 | ||
ports: | ||
- 5432:5432 | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.75' | ||
memory: '0.5GB' | ||
app1: | ||
image: lukas8219/rinha-be-2023-q3:latest | ||
environment: | ||
DB_URL: "postgres://postgres:12345678@postgres:5432/postgres" | ||
BATCH: "true" | ||
CLUSTER: "false" | ||
ports: | ||
- "8080" | ||
depends_on: | ||
- postgres | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.25' | ||
memory: '0.5GB' | ||
app2: | ||
image: lukas8219/rinha-be-2023-q3:latest | ||
environment: | ||
DB_URL: "postgres://postgres:12345678@postgres:5432/postgres" | ||
BATCH: "true" | ||
CLUSTER: "false" | ||
ports: | ||
- "8080" | ||
depends_on: | ||
- postgres | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.25' | ||
memory: '0.5GB' | ||
nginx: # Load Balancer | ||
image: nginx:latest | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
depends_on: | ||
- app1 | ||
- app2 | ||
ports: | ||
- "9999:9999" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.25' | ||
memory: '0.5GB' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
events { | ||
# configure como quiser | ||
} | ||
http { | ||
upstream api { | ||
server app1:8080; | ||
server app2:8080; | ||
} | ||
server { | ||
listen 9999; | ||
location / { | ||
proxy_pass http://api; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters