Forums

Bandwith v.s. Web Workers & Custom Accounts

Hi PythonAywhere Team,

I had a couple questions regarding web workers & bandwith that I thought you guys might be able to help with.

  • How would I go about determining the 'required' number of webworkers of my application?
  • Does purchasing more web workers also increase bandwith and if not, is there a way I can pay to increase an applications bandwith?
  • Is there a way to test the effects of increasing the bandwith provided to an application?

Thank you for your help!

Hi there

  • this depends on your forecasted traffic / load, and the average / worst case response time for request. for example, if you have one slow endpoint that takes 10 seconds to process a single request, and you anticipate say 10 people simultaneously clicking on it, then with 10 or less workers, any further attempts to access any part of your website will be blocked for 10 seconds
  • we implement a fuzzy bandwidth system, and there is no way to increase bandwidth beyond what we offer-- in general the effect of bandwidth of minor on your webapp- stuff like the number of concurrent workers, or putting a caching service (eg: cloudflare) in front of PythonAnywhere is where the majority of the gains are.

Hi Conrad,

Thanks for the quick reply and the reference to cloudflare! So just to make sure i'm following, the minimum number of webworkers my applicaiton requires would be determined by the maximum number of users accessing the app concurrently at any given time?

<br>

If that's the case would increasing the minimum number of webworkers increase the gains? For example, in a scenario where 2 users accessing one application simultaneously, would there be any difference in performance between an account paying for 2, 5, or 10 web workers?

Thanks for the help Conrad.

It's not a direct relation between workers and users. Each worker can handle one request at a time, so the number of workers that you may need will depend heavily on how long your views take to respond. For instance: if you have 2 workers and your views generally take 0.5s to respond, you can handle 4 requests per second. But, if your views take only 0.1s to respond, then you can handle 20 requests per second.