In my current project, I have a Django web app which both receives data from a number of external sensors, and has a function to view said data. I have left it during the holidays to collect data, and I have now tried to access the data, but I have noticed that the website is insanely slower.
In my function, I have a timing function to estimate the time, and the code which reads the data with minimum calculations took 12 seconds of processing time, which is many, many magnitudes higher than it used to be (much less than even 1 second!), and of course, since the program is set to try and load the data every few seconds, the response can take progressively longer (since Javascript was sending requests before it can receive it, but I can work on realizing how to fix that part specifically).
I've been trying to lookup some solutions, I've saw the page at https://help.pythonanywhere.com/pages/MySiteIsSlow and I have tried to test some of the things and see what was the issue.
I am using MySql, and I have tested the database using the console and the response is as quick as it needs to be (basically instant to retrieve a few fields), and I couldn't find any of the clear reasons for the slowdown.
The only thing I can think off is increasing the web workers, but I am not sure if that could help and I don't want to increase it unless its the last option (I am still not convinced that a few sensors sending and one/two users opening data with a few seconds in between should need that many more web workers, but I could be wrong.).
Could lack of web workers slow down the operations themselves? It was my understanding that it could mean that the server might take longer to start processing the data, but I didn't think it also slowed down the processing itself, or does it?
Thank you for your time.
Zaid