Skip to content

Instantly share code, notes, and snippets.

View drhlxiao's full-sized avatar

Hualin Xiao drhlxiao

View GitHub Profile
@drhlxiao
drhlxiao / nginx-tuning.md
Created July 10, 2019 18:53 — 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.

@drhlxiao
drhlxiao / solarSystem.py
Last active January 23, 2019 14:31 — forked from mick001/solarSystem.py
Solar system simulation in Python. Full article and video at http://www.firsttimeprogrammer.blogspot.com/2014/12/and-here-comes-whole-solar-system.html
import math
from bigfloat import *
import matplotlib.pyplot as plt
from visual import *
# A class to handle the time ranges
class timeHoursSeconds(object):
def __init__(self,s,h,d,y):
self.s = s
self.h = h
@drhlxiao
drhlxiao / ThresholdingAlgo.py
Created December 16, 2018 21:53 — forked from ximeg/ ThresholdingAlgo.py
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)