diff --git a/python3.6-alpine3.8/gunicorn_conf.py b/python3.6-alpine3.8/gunicorn_conf.py index c63c8e84..7152b653 100644 --- a/python3.6-alpine3.8/gunicorn_conf.py +++ b/python3.6-alpine3.8/gunicorn_conf.py @@ -2,7 +2,7 @@ import multiprocessing import os -workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2") +workers_per_core_str = os.getenv("WORKERS_PER_CORE", "1") web_concurrency_str = os.getenv("WEB_CONCURRENCY", None) host = os.getenv("HOST", "0.0.0.0") port = os.getenv("PORT", "80") @@ -20,7 +20,7 @@ web_concurrency = int(web_concurrency_str) assert web_concurrency > 0 else: - web_concurrency = int(default_web_concurrency) + web_concurrency = max(int(default_web_concurrency), 2) # Gunicorn config variables loglevel = use_loglevel diff --git a/python3.6/gunicorn_conf.py b/python3.6/gunicorn_conf.py index c63c8e84..7152b653 100644 --- a/python3.6/gunicorn_conf.py +++ b/python3.6/gunicorn_conf.py @@ -2,7 +2,7 @@ import multiprocessing import os -workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2") +workers_per_core_str = os.getenv("WORKERS_PER_CORE", "1") web_concurrency_str = os.getenv("WEB_CONCURRENCY", None) host = os.getenv("HOST", "0.0.0.0") port = os.getenv("PORT", "80") @@ -20,7 +20,7 @@ web_concurrency = int(web_concurrency_str) assert web_concurrency > 0 else: - web_concurrency = int(default_web_concurrency) + web_concurrency = max(int(default_web_concurrency), 2) # Gunicorn config variables loglevel = use_loglevel diff --git a/python3.7-alpine3.8/gunicorn_conf.py b/python3.7-alpine3.8/gunicorn_conf.py index c63c8e84..7152b653 100644 --- a/python3.7-alpine3.8/gunicorn_conf.py +++ b/python3.7-alpine3.8/gunicorn_conf.py @@ -2,7 +2,7 @@ import multiprocessing import os -workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2") +workers_per_core_str = os.getenv("WORKERS_PER_CORE", "1") web_concurrency_str = os.getenv("WEB_CONCURRENCY", None) host = os.getenv("HOST", "0.0.0.0") port = os.getenv("PORT", "80") @@ -20,7 +20,7 @@ web_concurrency = int(web_concurrency_str) assert web_concurrency > 0 else: - web_concurrency = int(default_web_concurrency) + web_concurrency = max(int(default_web_concurrency), 2) # Gunicorn config variables loglevel = use_loglevel diff --git a/python3.7/gunicorn_conf.py b/python3.7/gunicorn_conf.py index c63c8e84..7152b653 100644 --- a/python3.7/gunicorn_conf.py +++ b/python3.7/gunicorn_conf.py @@ -2,7 +2,7 @@ import multiprocessing import os -workers_per_core_str = os.getenv("WORKERS_PER_CORE", "2") +workers_per_core_str = os.getenv("WORKERS_PER_CORE", "1") web_concurrency_str = os.getenv("WEB_CONCURRENCY", None) host = os.getenv("HOST", "0.0.0.0") port = os.getenv("PORT", "80") @@ -20,7 +20,7 @@ web_concurrency = int(web_concurrency_str) assert web_concurrency > 0 else: - web_concurrency = int(default_web_concurrency) + web_concurrency = max(int(default_web_concurrency), 2) # Gunicorn config variables loglevel = use_loglevel diff --git a/tests/test_01_main/test_defaults.py b/tests/test_01_main/test_defaults.py index 77ceb436..d5d4b8d6 100644 --- a/tests/test_01_main/test_defaults.py +++ b/tests/test_01_main/test_defaults.py @@ -12,11 +12,11 @@ def verify_container(container, response_text): config_data = get_config(container) - assert config_data["workers_per_core"] == 2 + assert config_data["workers_per_core"] == 1 assert config_data["host"] == "0.0.0.0" assert config_data["port"] == "80" assert config_data["loglevel"] == "info" - assert config_data["workers"] > 2 + assert config_data["workers"] >= 2 assert config_data["bind"] == "0.0.0.0:80" logs = get_logs(container) assert "Checking for script in /app/prestart.sh" in logs diff --git a/tests/test_01_main/test_env_vars_1.py b/tests/test_01_main/test_env_vars_1.py index 501ad06f..9ac9705e 100644 --- a/tests/test_01_main/test_env_vars_1.py +++ b/tests/test_01_main/test_env_vars_1.py @@ -12,7 +12,7 @@ def verify_container(container, response_text): config_data = get_config(container) - assert config_data["workers_per_core"] == 1 + assert config_data["workers_per_core"] == 2 assert config_data["host"] == "0.0.0.0" assert config_data["port"] == "8000" assert config_data["loglevel"] == "warning" @@ -57,7 +57,7 @@ def test_env_vars_1(image, response_text): container = client.containers.run( image, name=CONTAINER_NAME, - environment={"WORKERS_PER_CORE": 1, "PORT": "8000", "LOG_LEVEL": "warning"}, + environment={"WORKERS_PER_CORE": 2, "PORT": "8000", "LOG_LEVEL": "warning"}, ports={"8000": "8000"}, detach=True, ) diff --git a/tests/test_02_app/test_custom_app.py b/tests/test_02_app/test_custom_app.py index b434325c..4d298c7c 100644 --- a/tests/test_02_app/test_custom_app.py +++ b/tests/test_02_app/test_custom_app.py @@ -19,11 +19,11 @@ def verify_container(container, response_text): config_data = get_config(container) - assert config_data["workers_per_core"] == 2 + assert config_data["workers_per_core"] == 1 assert config_data["host"] == "0.0.0.0" assert config_data["port"] == "80" assert config_data["loglevel"] == "info" - assert config_data["workers"] > 2 + assert config_data["workers"] >= 2 assert config_data["bind"] == "0.0.0.0:80" logs = get_logs(container) assert "Checking for script in /app/prestart.sh" in logs diff --git a/tests/test_02_app/test_package_app.py b/tests/test_02_app/test_package_app.py index 9600da5e..f576f296 100644 --- a/tests/test_02_app/test_package_app.py +++ b/tests/test_02_app/test_package_app.py @@ -19,11 +19,11 @@ def verify_container(container, response_text): config_data = get_config(container) - assert config_data["workers_per_core"] == 2 + assert config_data["workers_per_core"] == 1 assert config_data["host"] == "0.0.0.0" assert config_data["port"] == "80" assert config_data["loglevel"] == "info" - assert config_data["workers"] > 2 + assert config_data["workers"] >= 2 assert config_data["bind"] == "0.0.0.0:80" logs = get_logs(container) assert "Checking for script in /app/prestart.sh" in logs diff --git a/tests/test_02_app/test_simple_app.py b/tests/test_02_app/test_simple_app.py index 1231599d..cb5644c9 100644 --- a/tests/test_02_app/test_simple_app.py +++ b/tests/test_02_app/test_simple_app.py @@ -19,11 +19,11 @@ def verify_container(container, response_text): config_data = get_config(container) - assert config_data["workers_per_core"] == 2 + assert config_data["workers_per_core"] == 1 assert config_data["host"] == "0.0.0.0" assert config_data["port"] == "80" assert config_data["loglevel"] == "info" - assert config_data["workers"] > 2 + assert config_data["workers"] >= 2 assert config_data["bind"] == "0.0.0.0:80" logs = get_logs(container) assert "Checking for script in /app/prestart.sh" in logs