Skip to content
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

SDK polling interval should use exponential backoff #39

Open
NHDaly opened this issue Aug 4, 2022 · 1 comment
Open

SDK polling interval should use exponential backoff #39

NHDaly opened this issue Aug 4, 2022 · 1 comment

Comments

@NHDaly
Copy link
Member

NHDaly commented Aug 4, 2022

It's currently hard-coded at 3 seconds which is too long for short queries:

interval = 3 * 1000, // 3 seconds

For example, the following 3 queries all report a time of 4.5 seconds in the console (1.5 seconds to return from the fast-path + 3 seconds until the next poll):

def insert:x = 2 * range[1,100 * 1000000,1]
def insert:x = 2 * range[1,200 * 1000000,1]
def insert:x = 2 * range[1,400 * 1000000,1]

But this one took 10.5 seconds (two more polling periods):

def insert:x = 2 * range[1,800 * 1000000,1]

We should instead use an exponential backoff for the polling period, similar to what we do in Julia:
https://github.com/RelationalAI/rai-sdk-julia/blob/935d4f1fe50e675ee462e290a0d3301a2d66d0a0/src/api.jl#L408-L419

Or, even better, Todd has suggested that we should set a much smaller exponent, based on the amount of time we've waited so far, rather than based on the time we slept for last. This is probably a better design, but might be a bit more work:
https://github.com/RelationalAI/rai-sdk-issues/issues/58

@billscheidel-rai
Copy link

Note: This issue has been migrated to https://relationalai.atlassian.net/browse/RAI-6270.

This link is only accessible to employees of RelationalAI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants