Skip to content

Instantly share code, notes, and snippets.

@vavrecan
Last active November 24, 2020 21:01
Show Gist options
  • Save vavrecan/58ad6d5714a8a96a0611ccacc2953f31 to your computer and use it in GitHub Desktop.
Save vavrecan/58ad6d5714a8a96a0611ccacc2953f31 to your computer and use it in GitHub Desktop.
Server setup 2020
/etc/security/limits.conf
#<user> <type> <item> <value>
* soft nofile 1048576
* hard nofile 1048576
root soft nofile 1048576
root hard nofile 1048576
/etc/sysctl.conf
net.ipv4.ip_local_port_range = 12000 65535
fs.file-max = 1048576
ps auxf | grep nginx
cat /proc/1167/limits | grep "open files"
nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
worker_rlimit_nofile 1048576;
events {
worker_connections 8000;
multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment