Skip to content

Commit

Permalink
adicionando participação do zan que não vale
Browse files Browse the repository at this point in the history
  • Loading branch information
zanfranceschi committed Aug 28, 2023
1 parent f6a3467 commit cc668c8
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 0 deletions.
5 changes: 5 additions & 0 deletions participantes/zanfranceschi/README.md
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)
7 changes: 7 additions & 0 deletions participantes/zanfranceschi/ddl.sql
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
);
82 changes: 82 additions & 0 deletions participantes/zanfranceschi/docker-compose.yml
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
21 changes: 21 additions & 0 deletions participantes/zanfranceschi/nginx.conf
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;
}
}
}
5 changes: 5 additions & 0 deletions participantes/zanfranceschi/run.sh
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

0 comments on commit cc668c8

Please sign in to comment.