Skip to content

Instantly share code, notes, and snippets.

View xDragonZ's full-sized avatar
🌴
On vacation

xDragonZ

🌴
On vacation
View GitHub Profile
@xDragonZ
xDragonZ / nginx-tuning.md
Created January 30, 2019 14:37 — 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.

@xDragonZ
xDragonZ / gist:7b491fea80339b25d858
Created September 22, 2015 16:42 — forked from diyism/gist:3f21b53d4b716ec53d0a
某手机应用REST API的签名算法翻译成php代码
<?php
echo 'unsign:<br>';
$base64='SFb+9uIIyCsmnqEfRl8zAhNU/E1tAPhISDC+bL9isqssivFWCHKZ3qqop/2c9M055H4=';
//$base64='GicrJfhqvKUCol1jsnhIZM2H/UQa8ZtGIs2HvZsnCDziSSIPKbo3QJEd7qvPwFJMOEs=';
//$base64='GykqJiswalge36/EHThFZfZOk0UbaRoUNiIBtyDZKQj2s7fdlSV5VrFDlSjETOvwg0s=';
echo 'base64: '.$base64.'<br>';
$str=base64_decode($base64);
echo 'mixed hex: '.bin2hex($str).'<br>';
$tmp=ord(substr($str, 1, 1))-36;
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static