Reports Using Long Running Query

October 5, 2024 by Igor Lozhkin
When a query takes a while to execute, users connected to Arnica WebReport may experience error messages related to timeouts on various layers of IT infrastructure: web servers, load-balancers, reverse proxies, etc. Adjusting timeouts to higher levels is possible in theory, however this can lead to other unanticipated consequences related to resource exhaustion (sockets, processes, memory, and others). Therefore, the problem of serving reports from long-running queries is unlikely to be resolved by adjusting timeout settings to higher levels. 

Pre-populating data sets with data from long-running queries requires special programming efforts and while it might solve the problem without risking infrastructure stability, this approach is often less practical.

Arnica WebReport provides an out-of-the box solution for serving data from long-running queries. The solution is based on using Arnica NanoQuery as a data source and specifying a wait timeout, which controls how quickly a browser sends a response to the user that the process started at the backend.

long_running_report_wait_timeout.png

User may click on RELOAD button which checks if the query completed.

long_running_report_initial_response.png

If the query is still running, user will still get the same response, but when results are ready the next RELOAD will show results:

long_running_report_final_response.png

With this approach users will not get timeout messages, and no infrastructure adjustment results will eventually be displayed.