Hi, I am not expecting any traffic as such on my website. Only people who I will manually share it with. It scrapes data off of a website. That's <5 seconds. I see that I have only 2 web workers. Do I need more? If yes, how do I add more.
Hi, I am not expecting any traffic as such on my website. Only people who I will manually share it with. It scrapes data off of a website. That's <5 seconds. I see that I have only 2 web workers. Do I need more? If yes, how do I add more.
If you visit your accounts page, you can click "Customize this plan", and then adjust your number of workers to exactly the number you want. It takes effect immediately (or at least, as soon as you restart your web apps), and we adjust your billing in the following month...
This is the answer on the forum. However, there is no "Customize" option on the accounts page? Also, will adding a worker cost more?
When you're logged in your PythonAnywhere account, go to the "Account" page, ensure you're on the "Upgrade/Downgrade Account" tab (which is the default one), then look for the "Custom" column (with grey background on the header) -- you'll find "Customize your plan" button there. If you click on it you'll see a pop up with sliders which enable you to change your settings; move the slider "Number of web workers" to indicate the number you require and you will see updated cost of that plan below.
Ah. Thanks. Got it.
Hi, I have a question about adding Web Workers too. If I add more web workers to my plan, I don't have to adjust my code?
No, you don't need to change things. Adding on web workers (and then reloading the site from the "Web" page) means that you wind up with more worker processes available to handle requests to your site, so it can handle more requests in parallel.
Thanks, good to know. Other question, we scrap data from multiple websites and import it in the app (100.000's). Will this go faster? and does the page load go faster with web workers? In short: What can I change in my plan so import and page load will get a boost?
The number of web workers is the number of instances of your web app code running at the same time, so it depends on implementation. Is your web app output rendered on a server as a whole or maybe is it based on multiple API calls from frontend to backed? In the first case adding workers won't help. In the second it could help. You may also consider offloading scraping to the always-on task, not doing it in the web app code, and only collecting results in the web app code. See Always-on tasks and Async work in Web apps
Thanks, for the reply. We don't have/use API's. Will each task use its own web workers? So we can run multiple tasks at once.
Tasks and web workers are unrelated. You can run up to 20 scheduled tasks in a paid account or as many always on tasks as you are paying for.