Skip to content

Instantly share code, notes, and snippets.

View byawitz's full-sized avatar

Binyamin Yawitz byawitz

View GitHub Profile
@denji
denji / nginx-tuning.md
Last active June 6, 2024 15:18
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.

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created December 10, 2017 10:43
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@ayubmalik
ayubmalik / docker-compose.yaml
Last active March 5, 2024 17:24
Kafka REST proxy with Docker compose. Everything required to get Confluent REST proxy docker images working so you can post messages to consumers with curl etc
---
version: '3.5'
networks:
default:
name: kafka-net
services:
zookeeper:
image: confluentinc/cp-zookeeper:4.1.1
hostname: zookeeper
@Meldiron
Meldiron / backup.sh
Last active June 8, 2024 02:40
Backup and Restore Appwrite, the lazy way 🐌
# Make sure to stop Appwrite before this backup,
# and make sure you have enough space on the machine.
# After backing up, make sure there is a file in 'backups/backup-___.tar.gz'.
# Also please check size of this file, it should be at least 5kb, even for small instances.
docker run --rm \
-v appwrite_appwrite-mariadb:/backup/appwrite-mariadb \
-v appwrite_appwrite-redis:/backup/appwrite-redis \
-v appwrite_appwrite-cache:/backup/appwrite-cache \
@Apocryphon-X
Apocryphon-X / Reflection-Module.md
Last active May 31, 2024 17:08
Handy V module to simplify the use of compile-time reflection.

Quickstart

Functions available in this module:

  - reflection.(*)_of_type[foo]()  // Extract details from type or struct
  - reflection.(*)_of(bar)         // Extract details from type instance 
  
(*) can be `methods`, `fields` or `attributes`.

Each function returns a map[string]T where T can be FunctionData, FieldData or StructAttribute respectively.