Hi service-dev folks,
We (primiano@ and I) recently did some brainstorming around GRC architecture with rockot@ and we wanted to bring the discussion to a wider audience since it seems it’ll probably be something that’ll come up for future servicification/GRC work as well.
Background: GRC goals.
GRC is a foundational service. It will receive input from content, Blink, mus+ash, etc. Think of it like a lightweight tracing extended to the service boundaries and add the novel use case of looping the performance metrics data back to Chrome for informing run-time decisions. The actual heuristics it needs to reason with to hint about optimal resource usage, necessarily have to involve domain-specific concepts like processes, tabs, frames, audio state, layers, etc.
This is to solve end-to-end performance problems like: if we know how many processes we have, and we know which processes are hosting the foreground frames, we can hint to V8 to give more GC headroom, and hence reduce pauses, on the active frames, throttle background frames, hint the compositor to drop tiles for tabs that have been not recently used, etc.
Concrete problem that triggered this discussion:
primiano@ is moving Memory-Infra into the GRC service. Today (pre-GRC) MI dumps raw information into the trace and consumes it offline (in: telemetry; chrome://tracing UI). We now need to have that information available within Chrome. The driving use cases are: (i) fixing memory UMA (go/memory-uma); (ii) making MI data available to MemoryCoordinator to take the proper decisions. In order to do this we need to have the knowledge of what is a “GPU process”, what is a “V8 heap”, “font caches” and so on.
primiano@ was about to plumb an enum inside GRC of the form ProcessType { kGpuProcess, kBrowserProcess, kRendererProcess, kUtilityProcess, kOtherUnknownProcess} to implement an API of the form “here’s the memory snapshot for this process”. In turn this is to ultimately summarize those snapshots into UMA/UKM keys of the form “Memory.GPU”, “Memory.Renderer” etc.
This raised some concerns of the form “A service shouldn’t know about the existence of renderers and the GPU process. Can you architect this in a more generic way?”.
Proposal
While we understand this architectural concerns around the service vision (specifically foundational services), we have a number of speed-related problems to face day by day. Our developers are constantly struggling with plumbing boilerplate and concerns are arising about the maintenance cost of several instrumentation frameworks (See V8ScriptRunner::RunCompiledScript as a key example of four different probes wrapping a script call).
Speed is by-nature a cross-cutting problem and we cannot easily solve it pretending to know nothing about the architecture of Chrome.
We are not stating that it is impossible to architect GRC it in a way that reflects the service layering. Our genuine fear is that enforcing that sort of architecture right now is IMHO premature and will slow down progress with big upfront designs.
Until both the servicification and GRC have more use cases, it would be great if we could keep things simple and revisit the internal architecture once all the use cases have been consolidated.
To clarify we are NOT talking about layering violations in terms of actual code dependencies (read: we are NOT talking about having GRC service depending on content/).
We are talking about being able to model Chrome-specific concepts in GRC (read: having Mojo struct that represent tabs, frames, layers) in order to receive the right signals from to then formulate the right hints.
We are aiming for an architecture for GRC which:
Enables us to formulate resource usage hints in one central location. This gives velocity to our developers that can quickly iterate on prototypes and capture data for experiments.
Doesn’t re-create all of the current layering plumbing that’s needed when, for example, getting an event up from Blink through //content all the way up to //chrome.
Doesn’t require us to over-design GRC until the use cases we care about are there.
Let us know what you think!
Hi service-dev folks,
We (primiano@ and I) recently did some brainstorming around GRC architecture with rockot@ and we wanted to bring the discussion to a wider audience since it seems it’ll probably be something that’ll come up for future servicification/GRC work as well.
Background: GRC goals.
GRC is a foundational service. It will receive input from content, Blink, mus+ash, etc. Think of it like a lightweight tracing extended to the service boundaries and add the novel use case of looping the performance metrics data back to Chrome for informing run-time decisions. The actual heuristics it needs to reason with to hint about optimal resource usage, necessarily have to involve domain-specific concepts like processes, tabs, frames, audio state, layers, etc.
This is to solve end-to-end performance problems like: if we know how many processes we have, and we know which processes are hosting the foreground frames, we can hint to V8 to give more GC headroom, and hence reduce pauses, on the active frames, throttle background frames, hint the compositor to drop tiles for tabs that have been not recently used, etc.
Concrete problem that triggered this discussion:
primiano@ is moving Memory-Infra into the GRC service. Today (pre-GRC) MI dumps raw information into the trace and consumes it offline (in: telemetry; chrome://tracing UI). We now need to have that information available within Chrome. The driving use cases are: (i) fixing memory UMA (go/memory-uma); (ii) making MI data available to MemoryCoordinator to take the proper decisions. In order to do this we need to have the knowledge of what is a “GPU process”, what is a “V8 heap”, “font caches” and so on.
primiano@ was about to plumb an enum inside GRC of the form ProcessType { kGpuProcess, kBrowserProcess, kRendererProcess, kUtilityProcess, kOtherUnknownProcess} to implement an API of the form “here’s the memory snapshot for this process”. In turn this is to ultimately summarize those snapshots into UMA/UKM keys of the form “Memory.GPU”, “Memory.Renderer” etc.
This raised some concerns of the form “A service shouldn’t know about the existence of renderers and the GPU process. Can you architect this in a more generic way?”.
Proposal
While we understand this architectural concerns around the service vision (specifically foundational services), we have a number of speed-related problems to face day by day. Our developers are constantly struggling with plumbing boilerplate and concerns are arising about the maintenance cost of several instrumentation frameworks (See V8ScriptRunner::RunCompiledScript as a key example of four different probes wrapping a script call).
Speed is by-nature a cross-cutting problem and we cannot easily solve it pretending to know nothing about the architecture of Chrome.
We are not stating that it is impossible to architect GRC it in a way that reflects the service layering. Our genuine fear is that enforcing that sort of architecture right now is IMHO premature and will slow down progress with big upfront designs.
Until both the servicification and GRC have more use cases, it would be great if we could keep things simple and revisit the internal architecture once all the use cases have been consolidated.
To clarify we are NOT talking about layering violations in terms of actual code dependencies (read: we are NOT talking about having GRC service depending on content/).
We are talking about being able to model Chrome-specific concepts in GRC (read: having Mojo struct that represent tabs, frames, layers) in order to receive the right signals from to then formulate the right hints.
We are aiming for an architecture for GRC which:
Enables us to formulate resource usage hints in one central location. This gives velocity to our developers that can quickly iterate on prototypes and capture data for experiments.
Doesn’t re-create all of the current layering plumbing that’s needed when, for example, getting an event up from Blink through //content all the way up to //chrome.
Doesn’t require us to over-design GRC until the use cases we care about are there.
Let us know what you think!
--
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev+unsubscribe@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CAEkU82xKbBhwwbzF1xPY6Hu-a%2BOwdTYbMOQ9zw78_Mo1fh8G3A%40mail.gmail.com.
On Tue, May 9, 2017 at 1:38 PM, 'Oystein Eftevaag' via services-dev <servic...@chromium.org> wrote:Hi service-dev folks,
We (primiano@ and I) recently did some brainstorming around GRC architecture with rockot@ and we wanted to bring the discussion to a wider audience since it seems it’ll probably be something that’ll come up for future servicification/GRC work as well.
Background: GRC goals.
GRC is a foundational service. It will receive input from content, Blink, mus+ash, etc. Think of it like a lightweight tracing extended to the service boundaries and add the novel use case of looping the performance metrics data back to Chrome for informing run-time decisions. The actual heuristics it needs to reason with to hint about optimal resource usage, necessarily have to involve domain-specific concepts like processes, tabs, frames, audio state, layers, etc.
This is to solve end-to-end performance problems like: if we know how many processes we have, and we know which processes are hosting the foreground frames, we can hint to V8 to give more GC headroom, and hence reduce pauses, on the active frames, throttle background frames, hint the compositor to drop tiles for tabs that have been not recently used, etc.
Concrete problem that triggered this discussion:
primiano@ is moving Memory-Infra into the GRC service. Today (pre-GRC) MI dumps raw information into the trace and consumes it offline (in: telemetry; chrome://tracing UI). We now need to have that information available within Chrome. The driving use cases are: (i) fixing memory UMA (go/memory-uma); (ii) making MI data available to MemoryCoordinator to take the proper decisions. In order to do this we need to have the knowledge of what is a “GPU process”, what is a “V8 heap”, “font caches” and so on.
primiano@ was about to plumb an enum inside GRC of the form ProcessType { kGpuProcess, kBrowserProcess, kRendererProcess, kUtilityProcess, kOtherUnknownProcess} to implement an API of the form “here’s the memory snapshot for this process”. In turn this is to ultimately summarize those snapshots into UMA/UKM keys of the form “Memory.GPU”, “Memory.Renderer” etc.
For this example, where is the code that does the UMA/UKM? i.e. in the GRC or in a consumer?
If it's a consumer, then maybe an option is to have the process types as strings, and the consumer can translate the string into an enum.
If it's the GRC, is it possible to prefix/append the process name to the UMA/UK keys. If that's not possible, then I think it's fine. Ken and I chatted about this; other places like service_manager will have to know what are different purposes for sandboxing needs.
This raised some concerns of the form “A service shouldn’t know about the existence of renderers and the GPU process. Can you architect this in a more generic way?”.
Proposal
While we understand this architectural concerns around the service vision (specifically foundational services), we have a number of speed-related problems to face day by day. Our developers are constantly struggling with plumbing boilerplate and concerns are arising about the maintenance cost of several instrumentation frameworks (See V8ScriptRunner::RunCompiledScript as a key example of four different probes wrapping a script call).
Speed is by-nature a cross-cutting problem and we cannot easily solve it pretending to know nothing about the architecture of Chrome.
We are not stating that it is impossible to architect GRC it in a way that reflects the service layering. Our genuine fear is that enforcing that sort of architecture right now is IMHO premature and will slow down progress with big upfront designs.
Until both the servicification and GRC have more use cases, it would be great if we could keep things simple and revisit the internal architecture once all the use cases have been consolidated.
I sympathize that bringing chrome-specific code now to /services has these extra constraints. FWIW, many of us are dealing with this.I do think we want to be careful, as this argument is a slippery slope. It'd be great to send other examples to this list so we can discuss it, if they come up.
To clarify we are NOT talking about layering violations in terms of actual code dependencies (read: we are NOT talking about having GRC service depending on content/).
We are talking about being able to model Chrome-specific concepts in GRC (read: having Mojo struct that represent tabs, frames, layers) in order to receive the right signals from to then formulate the right hints.
FWIW this seems fine to me.
We are aiming for an architecture for GRC which:
Enables us to formulate resource usage hints in one central location. This gives velocity to our developers that can quickly iterate on prototypes and capture data for experiments.
Doesn’t re-create all of the current layering plumbing that’s needed when, for example, getting an event up from Blink through //content all the way up to //chrome.
Doesn’t require us to over-design GRC until the use cases we care about are there.
Let us know what you think!
--
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev...@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CAEkU82xKbBhwwbzF1xPY6Hu-a%2BOwdTYbMOQ9zw78_Mo1fh8G3A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev...@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CALhVsw3A_NsHoij8auoWB0gcGwdZGi3qcS8R8yd%2BfQuAAi7RGg%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "services-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/services-dev/v85DHRCtrl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to services-dev...@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CAMGE5NG0domtma1%2Bf1%3DdUhRcjVvNaJ9ygFWr0nqxi1xXuAeARQ%40mail.gmail.com.
If it's the GRC, is it possible to prefix/append the process name to the UMA/UK keys. If that's not possible, then I think it's fine. Ken and I chatted about this; other places like service_manager will have to know what are different purposes for sandboxing needs.UKM is going to be trickier because there the keys are not freeform but we have to fill a proto where the keys are determined a-priori. I'd like to avoid a state where every time something needs to know about chrome-specific concepts we have to plumb something from //service to //chrome. I don't see a clear advantage, as we'd just cheating with patterns like "who is gpu process? I am just a string that happens to contains ['g','p','u']" but on the other side we'll be adding more marshaling, string copies and ipc roundtrips.
This raised some concerns of the form “A service shouldn’t know about the existence of renderers and the GPU process. Can you architect this in a more generic way?”.
Proposal
While we understand this architectural concerns around the service vision (specifically foundational services), we have a number of speed-related problems to face day by day. Our developers are constantly struggling with plumbing boilerplate and concerns are arising about the maintenance cost of several instrumentation frameworks (See V8ScriptRunner::RunCompiledScript as a key example of four different probes wrapping a script call).
Speed is by-nature a cross-cutting problem and we cannot easily solve it pretending to know nothing about the architecture of Chrome.
We are not stating that it is impossible to architect GRC it in a way that reflects the service layering. Our genuine fear is that enforcing that sort of architecture right now is IMHO premature and will slow down progress with big upfront designs.
Until both the servicification and GRC have more use cases, it would be great if we could keep things simple and revisit the internal architecture once all the use cases have been consolidated.
I sympathize that bringing chrome-specific code now to /services has these extra constraints. FWIW, many of us are dealing with this.I do think we want to be careful, as this argument is a slippery slope. It'd be great to send other examples to this list so we can discuss it, if they come up.
To clarify we are NOT talking about layering violations in terms of actual code dependencies (read: we are NOT talking about having GRC service depending on content/).
We are talking about being able to model Chrome-specific concepts in GRC (read: having Mojo struct that represent tabs, frames, layers) in order to receive the right signals from to then formulate the right hints.
FWIW this seems fine to me.--
We are aiming for an architecture for GRC which:
Enables us to formulate resource usage hints in one central location. This gives velocity to our developers that can quickly iterate on prototypes and capture data for experiments.
Doesn’t re-create all of the current layering plumbing that’s needed when, for example, getting an event up from Blink through //content all the way up to //chrome.
Doesn’t require us to over-design GRC until the use cases we care about are there.
Let us know what you think!
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev...@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CAEkU82xKbBhwwbzF1xPY6Hu-a%2BOwdTYbMOQ9zw78_Mo1fh8G3A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "services-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to services-dev+unsubscribe@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/fbac18f2-5839-4747-8239-f2f8e9f17cb6%40chromium.org.
If it's the GRC, is it possible to prefix/append the process name to the UMA/UK keys. If that's not possible, then I think it's fine. Ken and I chatted about this; other places like service_manager will have to know what are different purposes for sandboxing needs.UKM is going to be trickier because there the keys are not freeform but we have to fill a proto where the keys are determined a-priori. I'd like to avoid a state where every time something needs to know about chrome-specific concepts we have to plumb something from //service to //chrome. I don't see a clear advantage, as we'd just cheating with patterns like "who is gpu process? I am just a string that happens to contains ['g','p','u']" but on the other side we'll be adding more marshaling, string copies and ipc roundtrips.Just to be clear, I think this stuff is fine to add. The most important point, which we all agree on, is that it doesn't include blink or content per services/readme.
The other stuff, like the ints or an enum for a process type, seems like stuff we can change in the future if we want to make GRC usable in other contexts and we find that they're hindering that.
--To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/fbac18f2-5839-4747-8239-f2f8e9f17cb6%40chromium.org.
You received this message because you are subscribed to a topic in the Google Groups "services-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/services-dev/v85DHRCtrl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to services-dev...@chromium.org.
To post to this group, send email to servic...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CALhVsw0%2B5%2BE9Qcd48P6uYm-igqG274jAA5NqMpeR-C9cXG4kzA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CA%2ByH71dq2WnP9L%3DCjuOCKSn_SZi4MoS0kSOaqq1gf%2Bf4Kc7_cw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/services-dev/CAMGE5NFWMDWYSG8A4FRprFiYRV%2B%3Dx5zL5cq-vAQhQiJRvH%2Bfyw%40mail.gmail.com.