Skip to content

Commit

Permalink
Merge pull request #494 from kytos-ng/change/api_threadpool_size
Browse files Browse the repository at this point in the history
Changed the default api threadpool size to 512
  • Loading branch information
Ktmi authored Aug 16, 2024
2 parents 0d5476f + 5709f70 commit c005772
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ Changed
- Updated test dependencies
- MongoDB version has been updated to 7.0
- Queue buffers event handlers will now handle and log broad exceptions keeping the task execution alive
- Raised the ``api`` threadpool workers to 512.

General Information
===================
- Kytos is tested and supported with mongo version 7.0. It can work with the lower versions 6.0 and 5.0 but they are not guaranteed to work flawlessly. To update mongo version follow these `steps <https://github.com/kytos-ng/kytos/pull/470>`_.
- If you encounter problems with the http api being unavailable (return code 503), then you should boost the ``api`` threadpool size. As a general rule of thumb you should have two ``api`` threads for every three EVCs.


[2023.2.0] - 2024-02-16
Expand Down
2 changes: 1 addition & 1 deletion kytos/core/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self, listen='0.0.0.0', port=8181,
)
kytos_conf = KytosConfig().options["daemon"]

api_threadpool_size = get_thread_pool_max_workers().get('api', 160)
api_threadpool_size = get_thread_pool_max_workers().get('api', 512)

concurrency_limit = kytos_conf.api_concurrency_limit
if concurrency_limit == 'threadpool':
Expand Down
4 changes: 2 additions & 2 deletions kytos/templates/kytos.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jwt_secret = {{ jwt_secret }}
# - sb: it's used automatically by kytos/of_core.* events, it's meant for southbound related messages
# - app: it's meant for general NApps event, it's default pool if no other one has been specified
# - db: it can be used by for higher priority db related tasks (need to be parametrized on decorator)
# - api: Not used by events, but instead API requests.
thread_pool_max_workers = {"sb": 256, "db": 256, "app": 512, "api": 160}
# - api: Not used by events, but instead API requests. For worst case scenario, should be equal to two thirds of the total EVCs.
thread_pool_max_workers = {"sb": 256, "db": 256, "app": 512, "api": 512}

# Queue monitors are for detecting and alerting certain queuing thresholds over a delta time.
# Each queue size will be sampled every second. min_hits / delta_secs needs to be <= 1
Expand Down

0 comments on commit c005772

Please sign in to comment.