onnela-lab / beiwe-backend

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe backend code
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
64 stars 46 forks source link

Update to data processing architecture to make push notifications not crash when a data processing task crashes the server #340

Open biblicabeebli opened 10 months ago

biblicabeebli commented 10 months ago

Now that we are running Forest tasks on the data processing servers we have a lot more room for stability issues to affect the data processing manager servers.

The fix is to adopt a new data processing manager/worker server structure where the manager server handles task distribution and push notifications, and the worker servers handles data processing, forest tasks, and the miscellaneous periodic scripts.

Manager still needs to run the log-uploading script, hmmmm. make a new server-task task-queue?

This will increase server costs, but unless we swap to a container-based backend its going to be painful to solve this. We can default this server type to a cheapo server though, push notifications currently take a matter of seconds every few minutes - But I would need to test this.

biblicabeebli commented 7 months ago

https://instances.vantage.sh/ (formerly ec2instances.info) is a good source for viewing server pricing.

Really shifting to containers would more fully solve our problems, but that's a huge lift and addition/change/support cost for the deploy scripts.

biblicabeebli commented 7 months ago

After finally ~nay, heroically~ fixing the memory leak in file processing the risk of losing a server to out-of-memory conditions is substantially reduced.