N
N
Navka12019-02-15 00:47:15
Nginx
Navka1, 2019-02-15 00:47:15

Gunicorn+Flask+Nginx+VK Api - slow request processing?

There is a Flask-powered bot that proxies through Gunicorn+WSGI. The settings for the Gyunicorn are as follows:

gunicorn --workers 40 --bind 127.0.0.1:9250 wsgi:app --worker-class gevent --timeout 30

The bot is used by a huge number of people at the same time, but it processes requests too slowly. In the community control panel, it constantly displays the error "Error: Timeout was reached. Attempt 2/5". Errors from the python side are fixed and are not displayed. However, requests are still processed slowly and, as it were, in "packs" - the bot will immediately answer all the people who have the old message hanging and go silent for a minute.
In which direction to dig, tell me?
UPD: pymongo is also used, which consumes a lot of resources, judging by the top command.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2019-02-15
@opium

Well, it’s logical to display python errors and everything will immediately become clear
Well, you need to read the python and unicorn ngix logs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question