As a bonus, in case you didn't figure it out already, sending the dependencies from browser to server means that servers will get far, far better information on which to make decisions about server push, especially when information about page visibility ends up being encoded in the ordering...
As usual, the design intent is to facilitate people writing their pages and letting the rest of the system do what needs be done to get the page rendered efficiently.
I have every hope that Jetty will continue to lead the way there ;)
-=R
Hi,
That's unavoidable right now.
On Wed, Nov 7, 2012 at 4:57 PM, William Chan (陈智昌)
<will...@chromium.org> wrote:
> * Now, if we have a forward proxy with a SPDY connection to an origin
> server, we have the analog of the two tab single user case. One client of
> the proxy may have the potential to request large, high priority resources
> that starves another user's low priority resources. That's bad.
What seems to take shape from these discussions is the existence of a
"super-stream" concept that aggregates requests that depend on each
other.
So we have a super-stream for index.html+1.js+2.js for userA, and
another super-stream for content.js+image.png for userB.
We want to be able to somehow play with priorities *within* the
super-stream, but not across super-streams in order to give every user
its share of bandwidth.
Within this model, I am still convinced that the browser can play well
enough with static priorities without the need of dynamic priorities.
Sorry I am not clear on this one.
> I think dependencies fixes a bug that is suboptimally addressed in SPDY
> today: sequential ordering. You *could* simply cycle through all priority
> levels (and potentially increase the number of priorities). That's totally
> valid, if ugly and brittle. For an audio/video stream where the audio/video
> is chunked, and you want each chunk to come in sequential order, you *could*
> use a priority value for each audio/video chunk. That's clearly possible but
> suboptimal, and you would have to induce delays to reset the wrap the
> priority once you run out of priority values to use.
Why you want to dynamically change priorities in such case ?
Want to listen to music using a background tab, but load fast pages in
other tabs ?
Is not this addressed by assigning a lower static priority to video
and audio streams ?
Hi,
Well, in the old days the browser could stop reading the HTML stream
On Sat, Nov 17, 2012 at 11:09 PM, William Chan (陈智昌)
<will...@chromium.org> wrote:
> Superstreams do not exist yet. That's why this proposal includes dependency
> trees to provide this concept. But that does not remove the need for dynamic
> reprioritization. Let's say one user requests a long html document that is
> 100MB large. Within this document, it references image resources and others
> that fit within the viewport. Beyond a certain point, the rest of the many
> megabytes of the html document are not as important as the image resources
> that would be rendered in the viewport. With static priorities, even though
> the html document is originally higher priority that the subresources, the
> browser has no way of conveying that the html document is no longer high
> priority since the rest of the content is not in the viewport.
that would have been stalled by flow control.
It is only that now the flow control window size is so big that you
can't rely on flow control to do this anymore.
But that would have been "the" way to control this use case.
But in the example about videoframes below you say that you *want* to
> That's simply
> a bug that SPDY would allow high priority resources to completely starve low
> priority resources like this.
starve videoframe2.
Hi,
Well, in the old days the browser could stop reading the HTML stream
On Sat, Nov 17, 2012 at 11:09 PM, William Chan (陈智昌)
<will...@chromium.org> wrote:
> Superstreams do not exist yet. That's why this proposal includes dependency
> trees to provide this concept. But that does not remove the need for dynamic
> reprioritization. Let's say one user requests a long html document that is
> 100MB large. Within this document, it references image resources and others
> that fit within the viewport. Beyond a certain point, the rest of the many
> megabytes of the html document are not as important as the image resources
> that would be rendered in the viewport. With static priorities, even though
> the html document is originally higher priority that the subresources, the
> browser has no way of conveying that the html document is no longer high
> priority since the rest of the content is not in the viewport.
that would have been stalled by flow control.
It is only that now the flow control window size is so big that you
can't rely on flow control to do this anymore.
But that would have been "the" way to control this use case.
Just to make it clear, I understand the use case of the 100 MiB HTML
and the images on the viewport, and I agree it's a valid use case.
I'd say "use flow control to do that", but somehow now flow control
windows have become so big that we need another flow control mechanism
in the form of reprioritization.
Hola spdy-dev friends.
I wanted to comment on Michael's Stream Dependency proposal. First, thanks for doing this! Work totally needs to be done in this area. Second, My apologies for not commenting sooner.. The blame there is mostly my own work load and the complexity of the proposal, but its also what always happens when something is worked on in great detail like this and then dumped over the public wall..
On 21 November 2012 05:46, Roberto Peon <fe...@google.com> wrote:I agree that a dependency tree is more expressive than just pure
> We know there are 4 resources we want to load: a,b,c,d. We can tell that b
> refers to a, and that d refers to c (thus a should load before b, and c
> should load before d). We later load the css, and discover that c,d are in a
> non-visible subtree of the DOM. Crap. No we have to change the priority for
> c,d. That means we need to *find* the correct priority for c,d, which in
> turn means we have to track what priorities we gave out to various things so
> we can discover the appropriate insertion point.
> I assert that ends up being more complicated that simply stating the
> dependency.
priorities. But I am not sure that we need to tell the server about
it.
Whatever data structure is used to represent the relationships between
the streams, the sender has to eventually reduce the available content
to send to a linear list of frames... which is essentially a priority
ordered list.
So what is the benefit of the client telling the server
the dependency tree rather than just the dynamic priorities derived
from such a tree? Is there any latency/round trips avoided by doing
so?
Any discovery made in the CSS of a non-visible subtree still needs to
be sent to the server, and it should not matter if it is sent as a
discovered tree or as resolved relative dynamic priorities.
Generally speaking, the client is going to have a lot more CPU
available to calculate such stuff than the server, plus it can
probably cope a lot better with any garbage generated from those
calculations. So if we can offload all the complex calculations of
dependencies to the client and just let the server deal with relative
dynamic priorities between the streams, then that is a big win.
On 29 November 2012 11:21, Roberto Peon <fe...@google.com> wrote:I'm not convinced that size is a significant issue here.
> IO is probably an order of magnitude more expensive than doing a lookup and
> swapping a couple of pointers. We should optimize for less of that instead
> if we're worried about the comparitive CPU cost.
Firstly sending the initial tree (each stream declares a parent) or
priority (each stream declares a priority) is going to be pretty much
equivalent.
For dynamic changes, many of the use cases appear to be the temporary
elevation of a single stream, so sending a new priority for that is
equivalent to sending a new dependency.
In the case where a two disjoint trees are joined, then it may be
necessary to adjust the priorities of less than half of the streams
(if more than half, just adjust the others in the other direction).
Typically we are talking about 10s of streams in parallel from a
browser, but even if this grows to 100s, then we are still talking
about less than 1 mtu going in the uncongested direction.
Granted that the savings in CPU/memory of priorities vs trees are also
probably marginal - but I do think there is good savings in complexity
with just priorities. A complex tree algorithm optionally
implemented by the server is going to create a lot more variance in
how resources are served, making it less worthwhile for browsers to do
the work of adjusting priorities in the first place.
node_a = FindNode(node_to_move) # O(lg N)RemoveNode(node_a) # O(1)node_b = FindNode(new_parent) # O(lg N)AddChild(node_b, node_a) # O(1)
def AddChild(parent, node):old_parent = node.parentdel node.parent.children[node]for child in node.children:child.parent = old_parent
parent.children.append(node)node.parent = parentEMIT_MOVE_TO_WIRE_HANDLER(node.stream_id, parent.stream_id)
def MarkPriorityUnused(p):p_a = FindPriority(node_to_move) # O(lg n)MarkPriorityUnused(p_a) # O(1)p_b = FindPriority(new_parent) # O(lg n)next_unused_priority, distance = FindFirstUnusedPrioritiesAfter(p_b) # O(n)
if distance == 1:AssignPriority(node_to_move, next_unused_priority)# O(1)else:MoveAllPrioritiesAfterXBy(p_b, 1) # O(n) # delta could be > 1 to help avoid future problemsAssignPriority(node_to_move, p_b + 1) # O(1)
def MoveAllPrioritiesAfterXBy(start_p, delta):del priorities[p]
def AssignPriority(node, p):for element in priorities_list:priority = element[0]if priority > start_p:element[0] += delta
priorities[p] = nodeEMIT_MOVE_TO_WIRE_HANDLER(node.stream_id, p)
So implementation efficiencies aside, my question is are there any
functional benefits of the server knowing the dependency tree rather
than just a set of priorities that may be derived from a tree in the
client?
I wouldn't say there's no use case, just no compelling example that
we've thought of yet. One example is images above and partially below
the fold, but this is fairly contrived. Any others?
> "Both priorities and stream dependencies are advisory hints" - I understandProcessing the messages is not optional. But, as a practical matter,
> why that's phrased as it is, but I'm wondering if this should be made
> stronger to push people to support it.. What is optional will be left out
> and forgotten.
servers have the final say over their bandwidth allocation policy. I
welcome suggestions for how to reword to encourage productive use of
the information.
> Given that, do we even need the MSClients do need some signal indicating if the server supports
> resolution? Seems like an LRU limit can do the job just fine. And I think we
> should specify a default recommended value.
dependency scheduling. But, you're right that LRU + max nodes covers
most use cases. One exception is if the server supports dependency
scheduling but needs to garbage collect quickly, e.g., in response to
a transient load spike. I'm not sure that's sufficiently compelling,
but others do, so it seems worth discussing. Thoughts?
Hi all,I'd like to share a draft proposal for adding a notion of stream dependencies to SPDY. Stream dependencies are intended to improve performance by providing hints to the server about which streams are most important to the client (and the relationships between those streams).A doc detailing the proposal:Comments welcome.Thanks!-Michael
Thanks for the comments -- edits are reflected here:
https://github.com/CSEMike/SPDY-Specification/commit/f324c8f30ef99b0dbe255cab032e43dbd8faae56
I've also moved the prioritization changes to a feature branch based
on gh-pages to ease future merging.
Detailed responses inline --
Done
On Mon, Jan 7, 2013 at 3:08 PM, Roberto Peon <fe...@google.com> wrote:
> 2) Leave the numbers as is and only change the wording to something like:
>
> "Lower numbers in the priority field indicate increased importance. A value
> of '0' in the priority field indicates highest importance"
Done.
> Some of the text in other sections needs modification, e.g.:
>
> "The user-agent is free to prioritize requests"
> I'd change this to:
> "The user-agent is free to prioritize or reprioritize"
I tweaked the discussion of prioritization to reflect the new changes
> More in the section containing the above (HTTP Request/Response under
> Request) needs changing.
and policy discussion in Section 6. What else did you have in mind?
You mean a mock scheduler? I think we'll need to chat a bit about what
> I'd suggest that a smple python implementation for server-side responding to
> the prioritization be included.
goes into this.
As a bonus, in case you didn't figure it out already, sending the dependencies from browser to server means that servers will get far, far better information on which to make decisions about server push, especially when information about page visibility ends up being encoded in the ordering...
As usual, the design intent is to facilitate people writing their pages and letting the rest of the system do what needs be done to get the page rendered efficiently.
I have every hope that Jetty will continue to lead the way there ;)
-=R