Skip to content

Change warehouse raw data endpoint to stream response.#1792

Merged
aaronweeden merged 1 commit intoubccr:xdmod11.0from
aaronweeden:stream-raw-data
Feb 27, 2024
Merged

Change warehouse raw data endpoint to stream response.#1792
aaronweeden merged 1 commit intoubccr:xdmod11.0from
aaronweeden:stream-raw-data

Conversation

@aaronweeden
Copy link
Copy Markdown
Contributor

@aaronweeden aaronweeden commented Nov 22, 2023

Description

This PR changes the rest/warehouse/raw-data endpoint to stream its response using chunked transfer encoding.

The endpoint now uses unbuffered MySQL queries (PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is set to false).

The endpoint now returns the entire result set rather than just a number of rows limited by the rest_raw_row_limit setting in portal_settings.ini. This PR removes that setting and the rest/warehouse/raw-data/limit endpoint since these are no longer needed.

For the Jobs realm, a request for multiple days of data is now run as multiple single-day queries to improve performance.

Motivation and Context

This PR makes it possible to obtain the entire result set while gaining the performance improvement from #1780 / #1800. This improves the responsiveness and simplifies the code in the xdmod-data API (see ubccr/xdmod-data#19).

By using unbuffered MySQL queries, the PHP memory usage is also reduced.

Tests performed

This PR updates the regression tests to account for the fact that the entire result set is returned.

I also set up my xdmod-dev port with this branch, ran the script from https://github.com/ubccr/xdmod-xsede/pull/436 with the --time argument, and confirmed there are no differences or duplicates.

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@aaronweeden aaronweeden added enhancement Enhancement of the functionality of an existing feature Category:Data Warehouse Export Data Warehouse Export Category: Data Analytics Framework php Pull requests that update Php code labels Nov 22, 2023
@aaronweeden aaronweeden added this to the 11.0.0 milestone Nov 22, 2023
@aaronweeden aaronweeden force-pushed the stream-raw-data branch 2 times, most recently from a54693c to 9e5b3d1 Compare November 27, 2023 18:19
@aaronweeden aaronweeden force-pushed the stream-raw-data branch 5 times, most recently from afcad93 to 5ee5dcb Compare December 14, 2023 17:53
@aaronweeden aaronweeden force-pushed the stream-raw-data branch 4 times, most recently from c4a3f8f to b328d05 Compare December 15, 2023 14:37
@aaronweeden aaronweeden merged commit facec86 into ubccr:xdmod11.0 Feb 27, 2024
@aaronweeden aaronweeden deleted the stream-raw-data branch February 27, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Data Analytics Framework Category:Data Warehouse Export Data Warehouse Export enhancement Enhancement of the functionality of an existing feature php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants