Skip to content

Instantly share code, notes, and snippets.

View vanics's full-sized avatar

Icaro Pacheco vanics

View GitHub Profile
@vanics
vanics / nginx-tuning.md
Created January 18, 2018 00:43 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

@vanics
vanics / kandypot-node.js
Created January 16, 2018 19:45 — forked from mort/kandypot-node.js
Node.js + Redis pubsub + Websockets for kandypot.com.
// Really trivial. On new writes to the redis db, we push messages to a websocket channel
var sys = require("sys"), redis = require('./lib/redis-client'), ws = require("./lib/ws");
var pubsub = redis.createClient();
var clients = new Array();
ws.createServer(function (websocket) {
websocket.addListener("connect", function (resource) {
sys.debug("connect: " + resource);
client_id = resource.match(/apps\/([A-Za-z]+)\/timeline$/)[1];
@vanics
vanics / install-redis.sh
Created January 16, 2018 18:30 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@vanics
vanics / nginx.default.conf
Created December 5, 2017 21:37 — forked from sumardi/nginx.default.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@vanics
vanics / firebase_copy.js
Created November 20, 2016 07:15 — forked from katowulf/firebase_copy.js
Move or copy a Firebase path to a new location
function copyFbRecord(oldRef, newRef) {
oldRef.once('value', function(snap) {
newRef.set( snap.value(), function(error) {
if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); }
});
});
}