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";
37
37
38
38
const DEFAULT_CHOICE_TTL = 60_000 * 60 * 24 * 30 ; // 30 days
39
39
40
- const DEFAULT_CLIENT_TTL = 15_000 ; // 15 seconds
40
+ const DEFAULT_CLIENT_TTL = 120_000 ; // 2 minutes
41
41
42
42
// NOTE: there are no assumptions here about clocks being synchronized. These
43
43
// are just ttl's.
@@ -79,8 +79,10 @@ export async function createStickyRouter({
79
79
// The client trusts a choice returned from the router for this long,
80
80
// or until the target is no longer available. Thus if the target
81
81
// 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.
84
86
clientTtl = DEFAULT_CLIENT_TTL ,
85
87
} : {
86
88
client : Client ;
You can’t perform that action at this time.
0 commit comments