added --cheaper-overload

This commit is contained in:
roberto@debian64
2012-02-01 16:07:29 +01:00
parent 99e4d55e9b
commit 30e8420342
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -653,7 +653,7 @@ int master_loop(char **argv, char **environ) {
healthy:
if (uwsgi.cheaper && !uwsgi.cheap && !uwsgi.to_heaven && !uwsgi.to_hell) {
if (overload_count > 3) {
if (overload_count > uwsgi.cheaper_overload) {
// activate the first available worker
int decheaped = 0;
for (i = 1; i <= uwsgi.numproc; i++) {
+3
View File
@@ -276,6 +276,7 @@ static struct uwsgi_option uwsgi_base_options[] = {
{"cheap", no_argument, 0, "set cheap mode (spawn workers only after the first request)", uwsgi_opt_true, &uwsgi.cheap, 0},
{"cheaper", required_argument, 0, "set cheaper mode (adaptive process spawning)", uwsgi_opt_set_int, &uwsgi.cheaper_count, UWSGI_OPT_MASTER|UWSGI_OPT_CHEAPER},
{"cheaper-step", required_argument, 0, "number of additional processes to spawn at each overload", uwsgi_opt_set_int, &uwsgi.cheaper_step, UWSGI_OPT_MASTER|UWSGI_OPT_CHEAPER},
{"cheaper-overload", required_argument, 0, "increase workers after specified overload", uwsgi_opt_set_64bit, &uwsgi.cheaper_overload, UWSGI_OPT_MASTER|UWSGI_OPT_CHEAPER},
{"idle", required_argument, 0, "set idle mode (put uWSGI in cheap mode after inactivity)", uwsgi_opt_set_int, &uwsgi.idle, 0},
{"die-on-idle", no_argument, 0, "shutdown uWSGI when idle", uwsgi_opt_true, &uwsgi.die_on_idle, 0},
{"mount", required_argument, 0, "load application under mountpoint", uwsgi_opt_add_app, NULL,0},
@@ -1172,6 +1173,8 @@ int main(int argc, char *argv[], char *envp[]) {
uwsgi.async = 1;
uwsgi.listen_queue = 100;
uwsgi.cheaper_overload = 3;
uwsgi.max_vars = MAX_VARS;
uwsgi.vec_size = 4 + 1 + (4 * MAX_VARS);
+1
View File
@@ -981,6 +981,7 @@ struct uwsgi_server {
// enable cheaper mode
int cheaper;
int cheaper_step;
uint64_t cheaper_overload;
// minimal number of running workers in cheaper mode
int cheaper_count;
// enable idle mode