-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Performance degradation for Application Screen with LoRaWAN devices #238
Comments
Hi @bkd231 |
Hi @bkd231 |
Hi @ramogens |
Good to hear @bkd231 ! |
We are experiencing a performance degradation issue that progressively worsens over time, which affects the loading of application data/screen related to LoRaWAN IoT devices. Initially (just after the os2iot backend was started), upon accessing the application screen, data related to LoRaWAN IoT devices is displayed immediately. However, after 1-2 hours of operation, the loading process becomes significantly slower, eventually resulting in timeouts and failure to display any data. Performing a service restart temporarily resolves the issue,. It is important to note that screens or applications without LoRaWAN devices load without any issues. The performance does return to normal after a service restart but degrades again after a short period.
The request from the frontend that times out calls the endpoint: /api/v1/application/{applicationId}/iot-devices?limit=5
The OS2IoT Backend processes the request and eventually needs to retrieve LoRaWAN devices' information from Chirpstack. To do this, the OS2IoT backend makes calls to Chirpstack for each device individually. This occurs within the findDevicesForApplication function in the ApplicationService, where there is a loop invoking the enrichLoRaWANDevice function of the ChirpstackDeviceService. Within this function, Chirpstack is queried twice for each device (devices/${deviceId}/keys and devices/${id}). We monitored the ingress to track requests from OS2IoT to Chirpstack for these endpoints. Our observations revealed that Chirpstack consistently handles the requests quickly. However, the interval between each request made by OS2IoT, while processing a single batch of sensor data, increases over time. Initially, the delay is only milliseconds after OS2IoT starts, but it can extend to several seconds (sometimes even 10-20 seconds) as the system continues to operate.
The text was updated successfully, but these errors were encountered: