Answer the question
In order to leave comments, you need to log in
What happens on the server at the time of the client's request?
Hello! I can't sleep for a week because of this question in my head :)
Let's say we have a regular "Hello world" deployed project in Flask. The client asks him this "Hello, world". I'm interested in: how does the Flask code interact directly with the client? An application instance is created or something else ... I still can’t understand, does Flask really work out the same code for 1000 requests per second? Sorry if this question requires psychic abilities, namely telepathy :)
Answer the question
In order to leave comments, you need to log in
> I'm interested in: how does the code from Flask interact directly with the client?
Depends on how the script using
flask is run, if you just run the python script in debug mode from the console,
then depending on the **options arguments, each new request
is served either by a separate thread or process, or just one request at a time.
If the question is about production, then let's say you have nginx + uwsgi and your script,
then uswgi will create how many workers are written in its configuration and they will take turns processing requests that nginx sends using WSGI
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question