From 0f86e7d368c80ff59c394d1db6884c6317773646 Mon Sep 17 00:00:00 2001 From: Vanshdeep Singh Date: Thu, 29 Mar 2018 16:26:54 +0200 Subject: [PATCH] Problem: Multi-threading not configured (#2165) * Problem: Multi-threading not configured Solution: Auto-generate multi-threading config with default threads and workers set to 1 * Problem: Documentation not updated for multi-threading Solution: Updated necessary docs --- bigchaindb/__init__.py | 3 ++- docs/server/source/server-reference/configuration.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bigchaindb/__init__.py b/bigchaindb/__init__.py index 673fe57f..8a9554ca 100644 --- a/bigchaindb/__init__.py +++ b/bigchaindb/__init__.py @@ -89,7 +89,8 @@ config = { 'bind': 'localhost:9984', 'loglevel': logging.getLevelName( log_config['handlers']['console']['level']).lower(), - 'workers': None, # if none, the value will be cpu_count * 2 + 1 + 'threads': 1, + 'workers': 1, # if None, the value will be cpu_count * 2 + 1 }, 'wsserver': { 'scheme': 'ws', diff --git a/docs/server/source/server-reference/configuration.md b/docs/server/source/server-reference/configuration.md index bb9dde2f..c55ba83e 100644 --- a/docs/server/source/server-reference/configuration.md +++ b/docs/server/source/server-reference/configuration.md @@ -103,7 +103,7 @@ These settings are for the [Gunicorn HTTP server](http://gunicorn.org/), which i [Gunicorn's documentation](http://docs.gunicorn.org/en/latest/settings.html#loglevel) for more information. -`server.workers` is [the number of worker processes](http://docs.gunicorn.org/en/stable/settings.html#workers) for handling requests. If `None` (the default), the value will be (2 × cpu_count + 1). Each worker process has a single thread. The HTTP server will be able to handle `server.workers` requests simultaneously. +`server.workers` is [the number of worker processes](http://docs.gunicorn.org/en/stable/settings.html#workers) for handling requests. If set to `None`, the value will be (2 × cpu_count + 1). Each worker process has a single thread. The HTTP server will be able to handle `server.workers` requests simultaneously. **Example using environment variables** ```text @@ -126,7 +126,7 @@ export BIGCHAINDB_SERVER_WORKERS=5 "server": { "bind": "localhost:9984", "loglevel": "info", - "workers": null, + "workers": 1, } ```