Skip to content

Commit

Permalink
Problem: Multi-threading not configured (#2165)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kansi authored and ttmc committed Mar 29, 2018
1 parent b4401d2 commit 0f86e7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bigchaindb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
'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',
Expand Down
4 changes: 2 additions & 2 deletions docs/server/source/server-reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -126,7 +126,7 @@ export BIGCHAINDB_SERVER_WORKERS=5
"server": {
"bind": "localhost:9984",
"loglevel": "info",
"workers": null,
"workers": 1,
}
```

Expand Down

0 comments on commit 0f86e7d

Please sign in to comment.