Skip to content

Instantly share code, notes, and snippets.

View miry's full-sized avatar

Michael Nikitochkin miry

View GitHub Profile
@miry
miry / nginx-tuning.md
Created June 26, 2019 08:23 — 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.

$ gem install zookeeper --verbose
HEAD https://rubygems.org/api/v1/dependencies
200 OK
GET https://rubygems.org/api/v1/dependencies?gems=zookeeper
200 OK
GET https://rubygems.org/quick/Marshal.4.8/zookeeper-1.4.11.gemspec.rz
200 OK
Downloading gem zookeeper-1.4.11.gem
GET https://rubygems.org/gems/zookeeper-1.4.11.gem
Fetching zookeeper-1.4.11.gem
package benchmarks
import (
"fmt"
"math/rand"
"testing"
)
/*
BenchmarkAccessStructure show compare metrics between data strucuture and number of items.
locals {
virginia_k8s_111_node_ec2_tags = [
{
key = "k8s.io/cluster-autoscaler/enabled"
value = "true"
propagate_at_launch = false
},
{
key = "kubernetes.io/cluster/${var.virginia_k8s_111_name}"
value = "${var.virginia_k8s_111_name}"
@miry
miry / kube_config.yaml
Created April 27, 2018 12:44
Sample config
apiVersion: v1
clusters:
- cluster:
certificate-authority: /Users/miry/.minikube/ca.crt
server: https://192.168.99.101:8443
name: kube
contexts:
- context:
cluster: kube
@miry
miry / README.md
Last active October 4, 2018 18:58
Terraform and Packer project hooks

Usage per project:

curl "https://gist.githubusercontent.com/miry/3db93ae3f76cb56c3689a2bf355ff1ee/raw/post-merge" > .git/hooks/post-merge
curl "https://gist.githubusercontent.com/miry/3db93ae3f76cb56c3689a2bf355ff1ee/raw/pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/post-merge
chmod +x .git/hooks/pre-commit
@miry
miry / node.cr
Last active April 5, 2018 12:28
How to convert type from `Node?` to `Node` ?
class Node
property value : String
property next : self | Nil
def initialize(@value : String | Nil)
end
def append(node : self)
last : self = self
while last.next
@miry
miry / app.json
Created April 1, 2018 14:19
Heroku container deployment
{
"name": "app",
"env": {
"RACK_ENV": "staging",
"RAILS_ENV": "staging",
"ROLLBAR_ENV": "staging",
"REDIS_PROVIDER": "REDISTOGO_URL",
"RAILS_LOG_TO_STDOUT": "true",
"RAILS_SERVE_STATIC_FILES": "true",
"SECRET_KEY_BASE": {
@miry
miry / volumes.tf
Created March 18, 2018 19:07
REsize Amazon EBS volumes without a reboot
resource "aws_ebs_volume" "mysql" {
availability_zone = "us-east-1a"
size = 2000
type = "gp2"
tags {
Name = "mysql"
Role = "db"
Terraform = "true"
FS = "xfs"
}
@miry
miry / volumes.tf
Created March 18, 2018 19:05
REsize Amazon EBS volumes without a reboot: Step 3 Execute a script
// volumes.tf
// ...
resource "null_resource" "expand_disk" {
connection {
type = "ssh"
user = "ubuntu"
private_key = "${file("~/.ssh/id_rsa")}"
host = "${data.aws_instance.mysql.public_ip}"
}