Penalize cycle according to effective weight
This commit is contained in:
parent
57644e0256
commit
1a12a9b397
|
@ -2246,9 +2246,10 @@ static void session_outbound_item_schedule(nghttp2_session *session,
|
|||
int32_t weight) {
|
||||
size_t delta = item->frame.hd.length * NGHTTP2_MAX_WEIGHT / weight;
|
||||
|
||||
assert(session->last_cycle <= item->cycle);
|
||||
if (session->last_cycle < item->cycle) {
|
||||
session->last_cycle = item->cycle;
|
||||
}
|
||||
|
||||
session->last_cycle = item->cycle;
|
||||
item->cycle = session->last_cycle + delta;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,12 @@ static int stream_push_item(nghttp2_stream *stream, nghttp2_session *session) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
item->cycle = session->last_cycle;
|
||||
/* Penalize item by delaying scheduling according to effective
|
||||
weight. This will delay low priority stream, which is good.
|
||||
OTOH, this may incur delay for high priority item. Will see. */
|
||||
item->cycle =
|
||||
session->last_cycle +
|
||||
NGHTTP2_DATA_PAYLOADLEN * NGHTTP2_MAX_WEIGHT / stream->effective_weight;
|
||||
|
||||
switch (item->frame.hd.type) {
|
||||
case NGHTTP2_DATA:
|
||||
|
|
Loading…
Reference in New Issue