-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adicionando participação do zan que não vale
- Loading branch information
1 parent
f6a3467
commit cc668c8
Showing
5 changed files
with
120 additions
and
0 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,5 @@ | ||
# Dotnet 7 com C#, PostgreSQL e Redis | ||
|
||
Github: [@zanfranceschi](https://github.com/zanfranceschi) | ||
Twitter: [@zanfranceschi](https://twitter.com/zanfranceschi) | ||
Repo da API: [https://github.com/zanfranceschi/rinha-de-backend-2023-q3-csharp](https://github.com/zanfranceschi/rinha-de-backend-2023-q3-csharp) |
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,7 @@ | ||
CREATE TABLE public.pessoas ( | ||
id UUID PRIMARY KEY NOT NULL, | ||
apelido VARCHAR(32) UNIQUE NOT NULL, | ||
nome VARCHAR(100) NOT NULL, | ||
nascimento DATE NOT NULL, | ||
stack TEXT NULL | ||
); |
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,82 @@ | ||
version: "3.5" | ||
services: | ||
db: | ||
image: postgres:latest | ||
hostname: db | ||
environment: | ||
- POSTGRES_PASSWORD=123 | ||
- POSTGRES_USER=admin | ||
- POSTGRES_DB=rinha | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ./ddl.sql:/docker-entrypoint-initdb.d/ddl.sql | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.05" | ||
memory: "0.4GB" | ||
|
||
cache: | ||
hostname: cache | ||
image: redis:latest | ||
command: redis-server --save "" --appendonly no | ||
ports: | ||
- "6379:6379" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.06" | ||
memory: "0.5GB" | ||
|
||
api01: &api | ||
image: zanfranceschi/rinha-api-2023 | ||
hostname: rinha-api01 | ||
depends_on: | ||
- db | ||
- cache | ||
environment: | ||
# https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector | ||
- DB_CONNECTION_STRING=Host=db;Username=admin;Password=123;Database=rinha;Connection Pruning Interval=1;Connection Idle Lifetime=2; | ||
- _DB_CONNECTION_STRING=Host=db;Username=admin;Password=123;Database=rinha; | ||
- CACHE_CONNECTION_STRING=cache | ||
- DOTNET_GCConserveMemory=1 | ||
- DOTNET_gcServer=1 | ||
- DOTNET_gcConcurrent=0 | ||
- _DOTNET_GCHeapCount=0x1 | ||
- _DOTNET_GCNoAffinitize=1 | ||
- _DOTNET_GCHeapHardLimitPercent=0x10 | ||
ports: | ||
- "8081:80" | ||
expose: | ||
- "80" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.568" | ||
memory: "1.0GB" | ||
|
||
api02: | ||
<<: *api | ||
ports: | ||
- "8082:80" | ||
|
||
nginx: | ||
image: nginx:latest | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
depends_on: | ||
- api01 | ||
- api02 | ||
ports: | ||
- "9999:9999" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.2" | ||
memory: "0.1GB" | ||
|
||
networks: | ||
default: | ||
driver: bridge | ||
name: rinha |
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,21 @@ | ||
events { | ||
worker_connections 5000; | ||
use epoll; | ||
} | ||
http { | ||
access_log off; | ||
sendfile on; | ||
|
||
upstream api { | ||
server api01; | ||
server api02; | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/bash | ||
|
||
docker-compose rm -f | ||
docker-compose down --rmi all | ||
docker-compose up --build |