Forums

Running in Separate Instances

Hi,

I have deployed my Python code in pythonanywhere and exposed as API using Flask.

Whenever I make a post request, it is taking around 10 min to run. It is producing the desired results.

Suppose if I am making simultaneous request, simultaneous run is not happening for both the requests. In the first 10 min it is producing the result for the first request. After that second request run is happening.

Ideally this should not happen, simultaneous run should happen?

Thanks and Regards, Diwakar G

Just to make sure that I understand correctly -- you have a Flask app on PythonAnywhere, and when you make a request to it, it does some stuff that takes some time. When you make two requests, it processes the first one, then processes the second one. What you'd like it to do is process both simultaneously. Is that correct?

If so, the reason it's happening that way is that you have a free account. Free accounts have one process handling their requests, and it processes them one at a time. A Hacker account gets two processes, and other kinds of accounts have more -- you can configure exactly how many by customizing the account when you upgrade.

How many process can be handled by Web dev account?

a web dev account has 3 web workers by default. (you can customize how many you want when you upgrade)