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

Loadtests #2718

Closed
wants to merge 14 commits into from
Closed
2 changes: 1 addition & 1 deletion counterparty-core/counterpartycore/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def float_range_checker(arg):
("--gunicorn-workers",),
{
"type": int,
"default": 2 * os.cpu_count() + 1,
"default": 2 * os.cpu_count() + 1 - 2, # - 2 to account for the follow and api watcher processes
"help": "number of worker processes for gunicorn (if enabled)",
},
],
Expand Down
10 changes: 5 additions & 5 deletions counterparty-core/counterpartycore/lib/api/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ def start_refresh_backend_height(timer_db, args):

class GunicornArbiter(Arbiter):
def __init__(self, app):
super().__init__(app) # Pass 'app' instead of 'app.cfg'
super().__init__(app)
self.app = app
self.timeout = 30
self.graceful_timeout = 30
self.max_requests = 1000
self.max_requests_jitter = 50

def handle_winch(self):
pass
Expand Down Expand Up @@ -167,6 +163,10 @@ class GunicornApplication(gunicorn.app.base.BaseApplication):
def __init__(self, app, args=None):
self.options = {
"bind": "%s:%s" % (config.API_HOST, config.API_PORT),
"timeout": 10,
"graceful_timeout": 10,
"max_requests": 1000,
"max_requests_jitter": 250,
"workers": config.GUNICORN_WORKERS,
"worker_class": "gthread",
"daemon": True,
Expand Down
Loading
Loading