Skip to content

Instantly share code, notes, and snippets.

View guilhermefarias's full-sized avatar
🛰️
Hello World

Guilherme Farias guilhermefarias

🛰️
Hello World
View GitHub Profile
@guilhermefarias
guilhermefarias / nginx-tuning.md
Created April 18, 2022 18:30 — 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.

@guilhermefarias
guilhermefarias / LC_CTYPE.txt
Created May 1, 2019 15:54 — forked from rafaotetra/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
var api = require('express')();
api.get('/api/user', function(request, response){
response.json({});
});
require('http').createServer(api).listen(3000);
@guilhermefarias
guilhermefarias / gist:6381657
Created August 29, 2013 18:29
Performance test: == or === ?
var t1,
t2,
test,
cont = 0,
element2 = 0,
element1 = '0';
t1 = performance.now();
while(cont < 2000000){
cont++;