Skip to content

Instantly share code, notes, and snippets.

View congto's full-sized avatar
🥁
Focusing

Tô Thành Công congto

🥁
Focusing
View GitHub Profile
@congto
congto / nginx-tuning.md
Created July 22, 2019 04:34 — 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.

Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
#!/bin/bash
MGMT_IP=$(ifconfig br-mgmt | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}')
HOST=$(hostname -s)
ADMIN_IP=$(hiera management_vip)
PUB_IP=$(hiera public_vip)
USER='masakari'
PASS='masakari'
DIR="$(dirname `readlink -f $0`)"
@congto
congto / notes.md
Created March 25, 2018 10:54 — forked from reterVision/notes.md
Linux Performance Tuning

1.1 Linux process management

  • process scheduling
  • interrupt handling
  • signaling
  • process prioritization
  • process switching
  • process state
  • process memory
@congto
congto / go-shebang-story.md
Created February 22, 2018 13:54 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@congto
congto / dev_setup_cephfs_nfs_manila.md
Created October 20, 2017 15:58 — forked from ajarr/dev_setup_cephfs_nfs_manila.md
All-in-one dev setup for manila's cephfs/nfs-ganesha driver

Dev testing manila's cephfs(NFS) driver

Reference https://docs.openstack.org/developer/manila/devref/cephfs_driver.html

Create all-in-one** CephFS/Ganesha/Manila setup using devstack in a CentOS7 machine similar to the one in the upstream gate, gate-manila-tempest-minimal-dsvm-cephfs-nfs-centos-7-nv

** Ceph server daemons (1 OSD, 1 MON, 1 MDS), NFS-Ganesha server, and manila-services all run in the same machine.

  • Clone devstack
@congto
congto / CiscoKeyGen.py
Created August 2, 2017 05:36 — forked from paalfe/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@congto
congto / openresty-ubuntu-install.sh
Created April 25, 2017 13:52 — forked from developersteve/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@congto
congto / openresty-ubuntu-install.sh
Created April 25, 2017 13:52 — forked from kingtuna/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@congto
congto / haproxy_corosync_pacemaker_ubuntu.md
Created March 11, 2017 11:26 — forked from Ham5ter/haproxy_corosync_pacemaker_ubuntu.md
Set up HAProxy with Pacemaker/Corosync on Ubuntu 16.04

Set up HAProxy with Pacemaker/Corosync on Ubuntu 16.04

This Document roughly describes a HAProxy Cluster Setup on Ubuntu 16.04 based on an example Configuration with 3 Nodes

This Document is still work in Progress the Following Stuff still needs to be done:

  • Explain the crm configure steps
  • explain Miscellaneous CRM Commands for Cluster Management
  • Add all the external ressources used.
  • Add a simple HAProxy Configuration for testing purpouse