Forums

How to scale computationally

My main application is a page which takes something like 10 sec to 1min to give the results.

Currently (beginner account) when flask is computing the page for one user, another user cannot access the website.

What are the next step to scale to say... 1000 request on this app at the same time ? Just change account or configure differently.

I'd say both! trying to optimise your code so that it takes less long would be a win. upgrading your account will give you more web workers to handle requests in parallel. you can also look into moving some work into an async queue: http://help.pythonanywhere.com/pages/AsyncInWebApps

Thanks for the link i will check that!

So my question is this indeed... :

If I upgrade to say... hacker account i have 2 web workers, so is my website going to directly be able to serve 2 person at once ?? And Web Developer would give me 3 people at once.

But what if I want to serve like 100 person at once? (like if I post on reddit/HN and people want to try it ?)

Right now my code looks basically like this:

    @app.route("/mainprogram/<striing>", methods=['GET'])

    def hello_world(striing):

            return do_something_with_my_main_program_which_takes_up_to_1min(string)

You can upgrade to up to 70 web workers if you want. But I would look into the other two options as well.

  1. upgrade
  2. optimise
  3. use an async task queue.