D
D
Dmitry Vyatkin2016-12-30 22:42:47
Django
Dmitry Vyatkin, 2016-12-30 22:42:47

How to handle multiple requests in python at the same time?

Good evening, Happy New Year everyone!
I have django running on the server through gunicorn + nginx, the application works with api social networks vk, fb, etc., receives a token for the user and sends posts to their pages. The post contains an image, link, text.
In this case, it turns out that the request via api to the social. network has been going on for quite some time.
Do I understand correctly that with constant requests to my server from users, they queue up and wait for requests from previous users to pass?
If so, then it seems to me that I need to execute the logic of my application asynchronously and asyncio is best suited for this.
Is it so?
How difficult is it to put everything together with Asyncio, Django, Gunicorn, Nginx, or is it better to use Asynchttp and other libraries for Asyncio?
It is planned that up to 100 users will access the application at the same time, and my application will access different social networks. networks. How expedient is it to use Celery and make requests to social networks? networks in tasks, taking into account the fact that after the request I need to process responses from api?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-12-30
@sim3x

djanga is synchronous - you don't need to do something in it on asyncio
use seler
write the state of the user's request to the database
make an ajax request in X seconds to the view and show the user the state of his request

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question