jlab-sensing / ENTS-backend

ENTS backend is a project to visualize data collected from a network of environmental sensors.
https://dirtviz.jlab.ucsc.edu/
MIT License
4 stars 8 forks source link

Backend crashing when streaming life data #226

Closed jmadden173 closed 5 months ago

jmadden173 commented 6 months ago

Describe the Bug

When viewing live data on Dirtviz the GET requests don't get processed fast enough causing a backlog of requests, eventually causing the backend to send 504 errors. I'm assuming the backend is crashing or is getting hung. The GET requests also prevent any data from the sensor being POSTed to the db, therefore nothing is showing up.

To Reproduce

Outline steps to reproduce the behavior:

  1. Goto dashboard
  2. Open web dev view
  3. Reload the page
  4. Select demo cell
  5. Wait for data to show for Phytos31
  6. Switch to streaming mode
  7. Observe behavior where GET request doesn't load in time for next request. Eventually a 504 will be returned
  8. On the things network POST requests also timeout

Expected Behavior

Live Phytos31 measurements should be showing on the plot.

Screenshots

Video demonstrating the problem

https://github.com/jlab-sensing/DirtViz/assets/31051736/1094a840-e4d8-4a4c-abfc-07d6ff6ca55e

Environment

Additional Context

I think this could be resolved by reducing the amount of time between live updates. Another possible alternative is turning on live data on a per graph plot. I'm still a little confused on why MFC measurements are working standalone.