#How to fast nginx? user www-data; worker_processes auto; pid /run/nginx.pid;
events {
worker_connections 4000;
# optmized to serve many clients with each thread, essential for linux
use epoll;
package: | |
exclude: | |
- node_modules/**/* | |
include: | |
handler.ts |
import { Handler, Context, Callback } from 'aws-lambda'; | |
interface HelloResponse { | |
statusCode: number; | |
body: string; | |
} | |
const hello: Handler = (event: any, context: Context, callback: Callback) => { | |
const response: HelloResponse = { | |
statusCode: 200, |
from __future__ import print_function | |
import os | |
import sys | |
from time import strftime, sleep | |
import boto3 | |
from botocore.exceptions import ClientError | |
VERSION_LABEL = strftime("%Y%m%d%H%M%S") | |
BUCKET_KEY = os.getenv('APPLICATION_NAME') + '/' + VERSION_LABEL + \ | |
'-bitbucket_builds.zip' |
window.initPlaceHolder = (textField) => { | |
const addEvent = document.addEventListener ? 'addEventListener' : 'attachEvent'; | |
const eventPrefix = document.addEventListener ? '' : 'on'; | |
const placeHolderClassName = 'usingPlaceHolder'; | |
const $trim = (string) => { | |
return string.trim ? string.trim() : string.replace(/^\s+|\s+$/g, ""); | |
}; | |
const $addClassName = (element, className) => { | |
var elClassName = element.className; | |
if(elClassName) |
Add below ppa and then install node and npm | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - |
let translate = ""; | |
const nodes = document.querySelectorAll('.SetPage-term'); | |
nodes.forEach(node => { | |
const en = `#${node.querySelector('.TermText.lang-en').textContent}`; | |
const ko = `#${node.querySelector('.TermText.lang-ko').textContent}`; | |
translate += `${en} ${ko}\n`; | |
}) |
server { | |
listen 20170; | |
root /var/www/html; | |
index index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location / { | |
try_files $uri $uri/ =404; |
#How to fast nginx? user www-data; worker_processes auto; pid /run/nginx.pid;
events {
worker_connections 4000;
# optmized to serve many clients with each thread, essential for linux
use epoll;
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 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (non-clustered) requests per second and 30% CPU load, course, this was 2xIntel Xeon with HT 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.
First, you will need to install nginx, my way to install nginx is compiling it from source, but for now we will use apt-get