Reserved upload slots for Subscribers?

I can’t directly do this, because of how everything works (between CityStrides as well as Strava limits). There might be something that can be done, though… Here are the details, maybe people smarter than me have some ideas. :smiley:

Strava Limits

This is detailed in CityStrides

  • 600 requests every 15 minutes
  • 30,000 requests every 24 hours

CityStrides sync types

  • Full account syncs; this is new members and any Supporters using the “Sync Now” feature
  • Individual activity syncs; Strava sends me alerts (webhooks) every time someone saves an activity in Strava which CityStrides responds to by saving the activity

CityStrides sync process

  • An activity sync uses 2 API requests to Strava.
  • A new-member account sync is 2 API requests per activity plus 1 API request per 100 activities. So 1,000 activities would be (1000/100)+(1000*2) = 2,010.
  • A Supporter using the “Sync Now” feature is a little more complicated because I’m skipping activities that already exist in CityStrides but I’m still iterating through all of them. The 1 API request per 100 activities is a constant but the 2 API requests per activity is only for activities that don’t exist in CityStrides.

Existing throttles

This is detailed in CityStrides
The reason for these throttles is to not block people from signing into CityStrides (sign in is an API request)

  • Syncing is paused with 100 remaining requests for the 15 minute limit
  • Syncing is paused with 1,000 remaining requests the 24 hour limit

Some ideas

  • Limit “Sync Now” to once per day
  • Allow webhooks to work as-is for Supporters, and handle non-Supporters differently (some ideas below)
    • Schedule non-Supporters to some time in the second half of the limiting period - if the API limits are all ok, then that would mean webhooks would schedule their activity sync to some time later in the 15-min period (or the next period if the current is exceeded) … if the 24-hour limit is reached, then their activity sync would be scheduled some time later in the next 24-hour period
    • Set up a daily non-Supporter limit e.g. 5,000 activities synced per day
  • Throttle new member activity syncing (or tie this into the daily non-Supporter limit)
  • Limit the number of new signups per day (I’m guessing that the bulk of the rate limit issue is on full-history syncing, which is from new signups)

I guess, taking a step back, CityStrides can sync roughly 15,000 activities per day and I need to figure out a way to split that up among new members, existing non-Supporters, and Supporters. :thinking:

2 Likes