File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ const SUBJECT = "sticky.one";
3737
3838const DEFAULT_CHOICE_TTL = 60_000 * 60 * 24 * 30 ; // 30 days
3939
40- const DEFAULT_CLIENT_TTL = 15_000 ; // 15 seconds
40+ const DEFAULT_CLIENT_TTL = 120_000 ; // 2 minutes
4141
4242// NOTE: there are no assumptions here about clocks being synchronized. These
4343// are just ttl's.
@@ -79,8 +79,10 @@ export async function createStickyRouter({
7979 // The client trusts a choice returned from the router for this long,
8080 // or until the target is no longer available. Thus if the target
8181 // is randomly vanishing and coming back and a reassignment gets made,
82- // this client would definitely find out if necessary within this amount of time.
83- // Basically this is roughly how long failover may take.
82+ // this client would definitely find out if necessary within this amount
83+ // of time. Basically this is roughly how long failover may take in the
84+ // worst imaginable situation (which is unlikely in practice). Making this
85+ // longer greatly reduces server load and increases scalability.
8486 clientTtl = DEFAULT_CLIENT_TTL ,
8587} : {
8688 client : Client ;
You can’t perform that action at this time.
0 commit comments