Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default workers_per_core to 1, and min concurrency to 2 #5

Merged
merged 3 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python3.6-alpine3.8/gunicorn_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python3.6/gunicorn_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python3.7-alpine3.8/gunicorn_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python3.7/gunicorn_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_01_main/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_01_main/test_env_vars_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_02_app/test_custom_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_02_app/test_package_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_02_app/test_simple_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down