Skip to content

Instantly share code, notes, and snippets.

View ildarmf's full-sized avatar
🌴

Ildar ildarmf

🌴
  • Frankfurt
View GitHub Profile
@ildarmf
ildarmf / nginx-tuning.md
Created July 28, 2018 21:21 — 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.

docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --publish=8080:8080 --detach=false --name=cadvisor cadvisor:20180330
I0330 08:06:28.976330 1 storagedriver.go:50] Caching stats in memory for 2m0s
I0330 08:06:28.976684 1 manager.go:151] cAdvisor running in container: "/sys/fs/cgroup/cpuacct,cpu"
I0330 08:06:28.999279 1 fs.go:139] Filesystem UUIDs: map[2ecd79ee-5c25-45b5-bb2a-f7d7d4908a42:/dev/sda4 7031eb24-d2f7-497b-a0d3-119ffab6f8ef:/dev/sda1 8806a345-6dc8-4149-93b0-fd0ea6ea372f:/dev/sda3 a9724b4d-4dbb-4a1e-88fb-47fa69f0467a:/dev/sda2]
I0330 08:06:28.999695 1 fs.go:140] Filesystem partitions: map[shm:{mountpoint:/dev/shm major:0 minor:101 fsType:tmpfs blockSize:0} none:{mountpoint:/ major:0 minor:100 fsType:aufs blockSize:0} tmpfs:{mountpoint:/dev major:0minor:104 fsType:tmpfs blockSize:0} /dev/root:{mountpoint:/rootfs major:8 minor:1 fsType:ext4 blockSize
du -sh * | sort -h
Docker RUN vs CMD vs ENTRYPOINT
Some Docker instructions look similar and cause confusion among developers who just started using Docker or do it irregularly. In this post I will explain the difference between CMD, RUN, and ENTRYPOINT on examples.
In a nutshell
RUN executes command(s) in a new layer and creates a new image. E.g., it is often used for installing software packages.
CMD sets default command and/or parameters, which can be overwritten from command line when docker container runs.
ENTRYPOINT configures a container that will run as an executable.
If it doesn’t make much sense or you after details, then read on.
Docker images and layers
docker run -d -p 4444:4444 --name selenium-hub -e GRID_MAX_SESSION=10 selenium/hub:3.8.1-erbium
docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm -e NODE_MAX_SESSION=5 -e NODE_MAX_INSTANCES=5 selenium/node-chrome:3.8.1-erbium
docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm -e NODE_MAX_SESSION=5 -e NODE_MAX_INSTANCES=5 selenium/node-firefox:3.8.1-erbium
#!/bin/bash
#set -x
List="/root/scripts/list"
NameCert=$(mount | grep "/mnt/ca/" | sed 's/\/mnt\/ca\///' | awk '{print $3}')
cp /dev/null /root/scripts/list
# Pathes where we going to search
FilePath=(
"/etc/nginx"
public String conCat(String a, String b) {
String str;
if(a.length()==0 | b.length()==0){
str = a+b;
}
else if(a.substring(a.length()-1, a.length()) == (b.substring(0,1))){
str = a + b.substring(2,b.length());
}
else{
str =a+b;
pg_dumpall -g
select * from db_activity;
psql -f roles.sql
###ДАМП
pg_dump -Fc processing > /tmp/proc180314.sql
РЕСТОР
1. Создал базу с таким же именем и владельцем, добавил тех же пользователей
ПРОВЕРЯЕМ ВЕРСИЮ pg_restore, нужно чтобы совпадала
pg_restore -V
def jobName = "job"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
@ildarmf
ildarmf / Jenkinsfile
Created December 18, 2017 18:27 — forked from clrung/Jenkinsfile
#!groovy
import groovy.json.JsonOutput
import java.util.Optional
import hudson.tasks.test.AbstractTestResultAction
import hudson.model.Actionable
import hudson.tasks.junit.CaseResult
def speedUp = '--configure-on-demand --daemon --parallel'
def nebulaReleaseScope = (env.GIT_BRANCH == 'origin/master') ? '' : "-Prelease.scope=patch"