I have purchased cloud server at digitalocean.com with 2GB RAM and DUAL CORE Processor. I want to set-up video proxy service i.e. to proxy youtube videos.
I have installed NGINX + PHP-FPM server and UFW firewall. But when more than 10 to 20 users stream, site slows down or becomes entirely unreachable.
Following are the configurations:
(NGINX CONFIGURATION)
user www-data;
worker_processes 2;
pid /var/run/nginx.pid;
events {
worker_connections 19000;
multi_accept on;
}
worker_rlimit_nofile 20000;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log off;
error_log /var/log/nginx/error.log crit;
##
# Gzip Settings
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
( PHP-FPM CONFIGURATION )
pm = static
pmm.max_children=1000
pm.process_idle_timeout = 10s
I also tried dynamic and ondemand configurations but no improvement.
pm = dynamic
pm.max_children = 1000
pm.start_servers=2
pm.min_spare_servers = 2
pm.max_spare_servers = 6
Please help in configuring this server.