mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 21:51:30 +00:00
improved process limit detection
This commit is contained in:
@@ -1112,6 +1112,7 @@ void sanitize_args() {
|
||||
uwsgi.ignore_write_errors = 1;
|
||||
}
|
||||
|
||||
|
||||
if (uwsgi.cheaper_count > 0 && uwsgi.cheaper_count >= uwsgi.numproc) {
|
||||
uwsgi_log("invalid cheaper value: must be lower than processes\n");
|
||||
exit(1);
|
||||
|
||||
+10
-1
@@ -1938,6 +1938,16 @@ int uwsgi_start(void *v_argv) {
|
||||
uwsgi_error("setrlimit()");
|
||||
}
|
||||
}
|
||||
|
||||
if (!getrlimit(RLIMIT_NPROC, &uwsgi.rl_nproc)) {
|
||||
if (uwsgi.rl_nproc.rlim_cur != RLIM_INFINITY) {
|
||||
uwsgi_log("your processes number limit is %d\n", (int) uwsgi.rl_nproc.rlim_cur);
|
||||
if ((int)uwsgi.rl_nproc.rlim_cur < uwsgi.numproc+uwsgi.master_process) {
|
||||
uwsgi.numproc = uwsgi.rl_nproc.rlim_cur - 1;
|
||||
uwsgi_log("!!! number of workers adjusted to %d due to system limits !!!\n", uwsgi.numproc);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef __OpenBSD__
|
||||
|
||||
@@ -1970,7 +1980,6 @@ int uwsgi_start(void *v_argv) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
uwsgi_log_initial("your memory page size is %d bytes\n", uwsgi.page_size);
|
||||
|
||||
if (uwsgi.buffer_size > 65536) {
|
||||
|
||||
Reference in New Issue
Block a user