Skip to content

Instantly share code, notes, and snippets.

View liwsakilive's full-sized avatar
💭
I'm Happy

Liwsaki Live liwsakilive

💭
I'm Happy
View GitHub Profile
@liwsakilive
liwsakilive / sysctl.conf
Created June 12, 2023 16:00
linux kernel tuning
fs.inotify.max_user_watches = 36864
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.netfilter.nf_conntrack_max = 10000000
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
vm.swappiness = 5
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables = 1
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus-deployment
namespace: prom
labels:
app: prometheus-server
spec:
replicas: 1
selector:
@liwsakilive
liwsakilive / sysctl-proxmox-tune.conf
Created June 18, 2022 20:39 — forked from sergey-dryabzhinsky/sysctl-proxmox-tune.conf
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###
# Generated by iptables-save v1.8.4 on Wed Mar 9 00:06:04 2022
*raw
:PREROUTING ACCEPT [653:47787]
:OUTPUT ACCEPT [691:96020]
-A PREROUTING -p tcp -m tcp -m multiport --dports 22,80,443,8443,20191,20192,20193,19999 -j ACCEPT
-A PREROUTING -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j CT --notrack
COMMIT
# Completed on Wed Mar 9 00:06:04 2022
# Generated by iptables-save v1.8.4 on Wed Mar 9 00:06:04 2022
*nat
@liwsakilive
liwsakilive / sysctl-anti-ddos.conf
Created March 3, 2022 19:51
tuning kernel for ddos protection
kernel.printk = 4 4 1 7
kernel.panic = 10
kernel.sysrq = 0
kernel.shmmax = 4294967296
kernel.shmall = 4194304
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
vm.swappiness = 20
vm.dirty_ratio = 80
#Convert vmware image to raw format image file
qemu-img convert -f vmdk -p -O raw machine.name.vmdk /opt/machine-name.img
#DD image into logical volume
dd if=machine-name.img of=/dev/vg_vmstore/lv_001-prod-machine-name-win001
#Use create virtual machine with existing disk
---
# You can use this file to override _any_ variable throughout Kolla.
# Additional options can be found in the
# 'kolla-ansible/ansible/group_vars/all.yml' file. Default value of all the
# commented parameters are shown here, To override the default value uncomment
# the parameter and change its value.
ansible_python_interpreter: /usr/bin/python3
###############
wget http://mirror.centos.org/altarch/7/extras/aarch64/Packages/centos-release-ceph-jewel-1.0-1.el7.centos.noarch.rpm
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-storage-common-2-2.el7.centos.noarch.rpm
wget https://cbs.centos.org/kojifiles/packages/centos-release-openstack-pike/1/0.el7/x86_64/centos-release-openstack-pike-1-0.el7.x86_64.rpm
wget https://cbs.centos.org/kojifiles/packages/centos-release-qemu-ev/1.0/2.el7/noarch/centos-release-qemu-ev-1.0-2.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-virt-common-1-1.el7.centos.noarch.rpm
rpm -ivh centos-release-ceph-jewel-1.0-1.el7.centos.noarch.rpm
rpm -ivh centos-release-storage-common-2-2.el7.centos.noarch.rpm
rpm -ivh centos-release-qemu-ev-1.0-2.el7.noarch.rpm
rpm -ivh centos-release-virt-common-1-1.el7.centos.noarch.rpm
@liwsakilive
liwsakilive / nginx-tuning.md
Created August 17, 2019 17:58 — 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.

@liwsakilive
liwsakilive / 60-zercle.conf
Created August 15, 2019 19:15 — forked from bouroo/60-sysctl.conf
Kernel tuning for dedicated linux server. /etc/sysctl.d/60-zercle.conf
# Kernel sysctl configuration file for Linux
# https://www.kernel.org/doc/Documentation/sysctl/
#
# Original by Michiel Klaver <https://klaver.it/linux/sysctl.conf>
# Modify by Kawin Viriyaprasopsook <kawin.vir@zercle.tech>
#
# The following is suitable for dedicated web server, mail, file server, KVM server etc.
# place file in /etc/sysctl.d/60-zercle.conf
# and run sysctl --system