Skip to content

Instantly share code, notes, and snippets.

View thienn1107's full-sized avatar
🏠
Working from home

Thien Nguyen Thanh thienn1107

🏠
Working from home
View GitHub Profile
swagger: '2.0'
info:
description: List all AWS EC2 instance with match State
version: 1.0.0
title: Inspectorio DevOps Assignment API
contact:
email: [email protected]
paths:
/healthz:
get:
global:
scrape_interval: 15s
evaluation_interval: 15s
external_labels:
monitor: 'xxx'
alerting:
alertmanagers:
- static_configs:
- targets:
--
- alert: InstanceDown
expr: up == 0
for: 1m
labels:
severity: warning
annotations:
summary: "Instance {{ $labels.instance }} down"
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."
@thienn1107
thienn1107 / .gitlab-ci.yml
Created November 14, 2018 07:47 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
stages:
- build-stg
- deploy-stg
build-stg:
stage: build-stg
script:
- cp .env.example.stg .env
- echo $CI_PROJECT_DIR
- npm install
rsync -rvz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /source/ [email protected]:/dest
gitlab-runner register -n \
--name "Name" \
--url "https://gitlab.com" \
--registration-token "token" \
--tag-list "PRODUCTION" \
--executor "shell"
@thienn1107
thienn1107 / nginx-tuning.md
Created July 3, 2018 02:24 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.