Skip to content

Commit

Permalink
try to reduce cpu usage ( #68 )
Browse files Browse the repository at this point in the history
  • Loading branch information
Seji64 committed Sep 9, 2024
1 parent ad65093 commit 909aed3
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions configs/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
load_module '/usr/lib/nginx/modules/ngx_stream_module.so';
worker_processes auto;
worker_rlimit_nofile 35000;

# Maximum number of open files per worker process.
# Should be > worker_connections.
worker_rlimit_nofile 8192;

events {
worker_connections 15000;
multi_accept off;
# If you need more connections than this, you start optimizing your OS.
# That's probably the point at which you hire people who are smarter than you as this is *a lot* of requests.
# Should be < worker_rlimit_nofile.
worker_connections 8000;
}

# Log errors and warnings to this file
# This is only used when you don't override it on a server{} level
error_log /dev/stderr warn;

# Free some CPU cycles
timer_resolution 500ms;

http {

client_body_timeout 10s;
client_header_timeout 10s;
keepalive_timeout 20s 20s;
send_timeout 10s;

access_log off;
error_log /dev/null crit;
server {
listen 8080 default_server;
listen [::]:8080 default_server;
Expand All @@ -23,7 +41,6 @@ http {


stream {
error_log /dev/null crit;
server {
resolver 1.1.1.1 ipv6=off;
listen 8443;
Expand Down

0 comments on commit 909aed3

Please sign in to comment.