Skip to content

Multithread timeseries#210

Closed
msweier wants to merge 14 commits intomainfrom
multithread_timeseries
Closed

Multithread timeseries#210
msweier wants to merge 14 commits intomainfrom
multithread_timeseries

Conversation

@msweier
Copy link
Collaborator

@msweier msweier commented Sep 17, 2025

Hi Guys,

Here's a first crack at adding multithreading.

  1. Multi-threading to get_timeseries
  • The function defaults to multi-threading and defaults to 20 threads and will chunk data by 14 days (assuming 15 minute data). It uses a helper function get_ts_extents from the catalog to check the extents of the timeseries to prevent requesting data for times outside the extents.
  1. Multi-threading to store_timeseries
  • The function defaults to multi-threading and defaults to 20 threads and will chunk data by 700 values (~14 days of 15 minute data). If it fails to store, it will start to backoff on how quickly it attempts to store.

Feel free to pull and make your own changes. I used a chatbot to help with a lot of it, so the code isn't very elegant but it works (although i"m sure there's improvements to be had). It seems pretty verbose for what is.

Using the local CDA, I was able to get a 6 min non-threaded call to 20 seconds. On the national instances the performance is much worse, but I think there may be some server limiting and performance issues on those.

I imaging we would want some tests for this, but I thought it would be good to get some input first.

@msweier msweier requested review from Enovotny and krowvin September 17, 2025 20:54
@msweier msweier added the help wanted Extra attention is needed label Sep 17, 2025
@msweier
Copy link
Collaborator Author

msweier commented Sep 18, 2025

Ok cleaned up the code a bit so its easier to follow and bumped up the default number of threads to 30 which work better on test and the national CDA for some reason.

@sonarqubecloud
Copy link

@msweier
Copy link
Collaborator Author

msweier commented Sep 30, 2025

Replaced by #219

@msweier msweier closed this Sep 30, 2025
@msweier msweier deleted the multithread_timeseries branch September 30, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant