Skip to content

[DeviantArt] Dynamic Throttle#8900

Draft
bbappserver wants to merge 1 commit intomikf:masterfrom
bbappserver:patch-1
Draft

[DeviantArt] Dynamic Throttle#8900
bbappserver wants to merge 1 commit intomikf:masterfrom
bbappserver:patch-1

Conversation

@bbappserver
Copy link

Deviantart throttling right now i kind of bad and can have quite poor recovery performance.

When the user makes a request within the throttle period the period is increased in a tarpit probably with some exponential factor less than 2 as the DA API doc say you should use 2 as your exp backoff factor.

Current backoff logic does not account for this and moves the delay linearly which causes the user to be repeatedly penalized if they get a 429 for a long time until their throttling value gets huge, because the linear client delay is smaller than the tarpit so they will be penalized until some reset.

There are two proposed changes in this update:

  • When a throttle happens use exponential backoff with a factor of 2.
  • Under normal conditions try increasingly smaller sleep values until you are rejected to converge to whatever DA's backend currently considers the ideal sleep time.

@bbappserver bbappserver force-pushed the patch-1 branch 2 times, most recently from e774e70 to 1efce7c Compare January 18, 2026 14:18
…ckoff

Introduced a LearningDelay class to manage API throttling dynamically. Updated the DeviantartOAuthAPI to utilize the new delay mechanism for improved handling of rate limits.

Recover frame rate limiting with exponential backoff instead of linear.
@mikf
Copy link
Owner

mikf commented Jan 18, 2026

By the way, I have plans on completely rewriting the DA module without any OAuth API usage. Soon ™️. So working on any OAuth API features or improvements is kind of pointless. At least in the long run.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants