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

participante gmrms #34

Merged
merged 1 commit 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
13 changes: 13 additions & 0 deletions participantes/gmrms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Submissão para Rinha de Backend, Segunda Edição: 2024/Q1 - Controle de Concorrência

<img src="https://upload.wikimedia.org/wikipedia/commons/1/11/Kotlin_logo_2021.svg" alt="logo clojure" width="200" height="auto">
<img src="https://upload.wikimedia.org/wikipedia/en/5/5a/MongoDB_Fores-Green.svg" alt="logo clojure" width="200" height="auto">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c5/Nginx_logo.svg" alt="logo nginx" width="200" height="auto">


## Guilherme Morum
Submissão feita com:
- `nginx` como load balancer
- `mongodb` como banco de dados
- `kotlin` para api com as libs `ktor` e `kmongo`
- [repositório da api](https://github.com/gmrms/rinha-2024Q1-ktor-mongo)
51 changes: 51 additions & 0 deletions participantes/gmrms/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
services:
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.18"
memory: "30MB"

api01: &api
image: gmorum/rinha-2024q1:ktor-mongo-v1
ports:
- "8070:8080"
environment:
- INIT_DB=true
- MONGO_CONNECTION_STRING=mongodb://mongo:27017
depends_on:
- mongo
deploy:
resources:
limits:
cpus: "0.52"
memory: "160MB"

api02:
<<: *api
depends_on:
- mongo
environment:
- INIT_DB=false
- MONGO_CONNECTION_STRING=mongodb://mongo:27017
ports:
- "8060:8080"

mongo:
image: mongo:7.0.3
ports:
- "27017:27017"
command: --quiet --logpath /dev/null
deploy:
resources:
limits:
cpus: "0.28"
memory: "200MB"
30 changes: 30 additions & 0 deletions participantes/gmrms/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
worker_processes auto;
worker_rlimit_nofile 500000;

events {
use epoll;
worker_connections 5000;
}

http {
access_log off;
sendfile on;

upstream api {
server api01:8080;
server api02:8080;
}

server {
listen 9999;

location / {
proxy_buffering off;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header Keep-Alive "";
proxy_set_header Proxy-Connection "keep-alive";
proxy_pass http://api;
}
}
}
Loading