openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyson Norris (Confluence)" <conflue...@apache.org>
Subject [CONF] OpenWhisk > UI Driven Use Cases
Date Sat, 01 Jul 2017 15:06:18 GMT
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 
<base href="https://cwiki.apache.org/confluence"> 
<title>Message Title</title>  
<style type="text/css">@media only screen and (max-device-width: 480px) {.mobile-only {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    line-height: normal !important;
    font-size: inherit !important;
    mso-hide: all;
}

.desktop-only {
    display: none !important;
}

/* iPhone 3GS fix for unwanted 20px right margin */
body {
    min-width: 100% !important;
    padding: 0;
    margin: 0;
}

#center-content-table {
    max-width: none;
!important;
}

#header-pattern-container {
    padding: 10px 10px 10px 10px !important;
    line-height: 20px !important;
}

#header-avatar-image-container {
    padding-right: 8px !important;
}

#email-content-container {
    padding: 0 !important;
}

.mobile-expand {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    padding-left: 26px !important;
}

.mobile-resize-text {
    font-size: 16px !important;
    line-height: 22px !important;
}

#page-title-pattern-header {
    font-size: 20px !important;
    line-height: 28px !important;
}

#page-title-pattern-icon-image-container-cell {
    padding-top: 7px !important;
}

#inline-user-pattern {
    display: block !important;
}

#inline-user-pattern-avatar {
    padding-top: 3px !important;
}

.contextual-area-pattern {
    border-bottom: 1px solid #ccc !important;
    padding: 15px 10px 0 10px !important;
}

.users-involved-pattern-column-table {
    width: 100% !important;
}

.users-involved-pattern-avatar-table-cell {
    padding: 3px 5px 5px 0 !important;
}

.users-involved-pattern-column-container {
    padding-right: 0 !important;
}

.contextual-excerpt-pattern, #users-involved-pattern {
    border: 0 !important;
}

/** Aui Typography upsized for mobile **/
#content-excerpt-pattern-container, #contextual-excerpt-pattern-text-container {
    font-size: 16px !important;
    line-height: 22px !important;
}

#content-excerpt-pattern-container h1, #contextual-excerpt-pattern-text-container h1 {
    font-size: 24px !important;
    line-height: 28px !important;
}

#content-excerpt-pattern-container h2, #contextual-excerpt-pattern-text-container h2 {
    font-size: 20px !important;
    line-height: 28px !important;
}

#content-excerpt-pattern-container h3, #contextual-excerpt-pattern-text-container h3 {
    font-size: 18px !important;
    line-height: 24px !important;
}

#content-excerpt-pattern-container h4, #contextual-excerpt-pattern-text-container h4 {
    font-size: 16px !important;
    line-height: 22px !important;
}

#content-excerpt-pattern-container h5, #contextual-excerpt-pattern-text-container h5 {
    font-size: 14px !important;
    line-height: 20px !important;
}

#content-excerpt-pattern-container h6, #contextual-excerpt-pattern-text-container h6 {
    font-size: 14px !important;
    line-height: 20px !important;
}

.user-mention {
    line-height: 18px !important;
}

/** Aui Typography end **/

/* Show appropriate footer logo on mobile, display links vertically */
#footer-pattern {
    padding: 15px 10px !important;
}

#footer-pattern-logo-desktop-container {
    padding: 0 !important;
}

#footer-pattern-logo-desktop {
    width: 0 !important;
    height: 0 !important;
}

#footer-pattern-logo-mobile {
    padding-top: 10px !important;
    width: 30px !important;
    height: 27px !important;
    display: inline !important;
}

#footer-pattern-text {
    display: block !important;
}

#footer-pattern-links-container {
    line-height: 0 !important;
}

.footer-pattern-links.mobile-resize-text,
.footer-pattern-links.mobile-resize-text,
#footer-pattern-text.mobile-resize-text,
#footer-pattern-links-container.no-footer-links {
    font-size: 14px !important;
    line-height: 20px !important;
}

.footer-link {
    display: block !important;
}

#footer-pattern-links-container table {
    display: inline-block !important;
    float: none !important;
}

#footer-pattern-links-container, #footer-pattern-text {
    text-align: center !important;
}

#footer-pattern-links {
    padding-bottom: 5px !important;
}

/** Team Calendar overrides, these should be removed when notifications are updated in Team Calendars. For now CSS
    overrides are being used because the structure of the content can't change without rereleasing the plugin */
.mail-calendar-container .day-header + table tr td:first-child {
    vertical-align: top !important;
    padding-top: 5px !important;
}}
@media (min-width: 900px) {#center-content-table { width: 900px; }}
@media all {#outlook a {
    padding: 0;
}

/* Force Outlook to provide a "view in browser" menu link. */
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.ExternalClass {
    width: 100%;
}

/* Force Hotmail to display emails at full width */
#background-table {
    margin: 0;
    padding: 0;
    width: 100% !important;
}

/* Needed to override highlighting on date and time links in iOS */
.grey a {
    color: #707070;
    text-decoration: none;
}/* These styles are appended to the head element of a notification in order to prevent Apple Mail and similar
   clients from underlining the due dates with a blue hyperlink */
/* a lozenge outside an inline task should always be #333, lozenges inside an inline task should be
   colored according to their upcoming due dates, a completed task date lozenge or deleted task date
   lozenge should always be #707070 */
.date-time-lozenge a {color: #333333; text-decoration: none; }
.inline-task-text-container .date-time-lozenge.date-upcoming a {color: #DF6F00; text-decoration: none; }
.inline-task-text-container .date-time-lozenge.date-past a {color: #D04437; text-decoration: none; }
.inline-task-text-container.content-deleted-color .date-time-lozenge a,
.inline-task-text-container.checked .date-time-lozenge a {
    color: #707070; text-decoration: none;
}}
</style> 
</head>
<body>
<table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; background-color: #f5f5f5"> 
<tbody> 
<tr> 
<td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
<table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 9px"><a href="https://cwiki.apache.org/confluence/display/~tysonnorris?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6" style="color: #3b73af; text-decoration: none"><img id="header-avatar-image" class="image_fix" src="cid:avatar_c25023a36d87469988374c2fb50978ae" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"></a></td>
<td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px">Tyson Norris <strong>created</strong> a page</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<!-- End Header pattern --> 
<tr> 
<td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
<table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; border-spacing: 0; border-collapse: separate"> 
<tbody> 
<tr> 
<td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 15px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px">&nbsp;</td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff"> 
<table id="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="page-title-pattern-icon-image-container" valign="top" style="padding: 0px; border-collapse: collapse; width: 16px; vertical-align: top"> 
<table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="page-title-pattern-icon-image-container-cell" style="padding: 0px; border-collapse: collapse; width: 16px; padding: 9px 8px 0px 0px; mso-text-raise: 5px; mso-line-height-rule: exactly"><a href="https://cwiki.apache.org/confluence/display/OPENWHISK/UI+Driven+Use+Cases?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=view" title="page icon" style="vertical-align: top;; color: #3b73af; text-decoration: none"><img style="vertical-align: top; display: block;" src="cid:page-icon" alt="page icon" title="page icon" height="16" width="16" border="0"></a></td> 
</tr> 
</tbody> 
</table> </td>
<td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" id="page-title-pattern-header-container"><span id="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"><a href="https://cwiki.apache.org/confluence/display/OPENWHISK/UI+Driven+Use+Cases?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=view" title="UI Driven Use Cases" style="color: #3b73af; text-decoration: none">UI Driven Use Cases</a></span></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff"> 
<table class="content-excerpt-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
<tbody> 
<tr> 
<td class="content-excerpt-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 0 24px"> <p style="margin: 10px 0 0 0; margin-top: 0">This proposal is a to outline an approach to OpenWhisk as a source for HTTP APIs that are used to drive UIs in browsers or mobile apps - "UI driven use cases" - compared to use cases where no user is present at the time of activation processing - "Event driven use cases".</p> <h2 id="UIDrivenUseCases-OriginalOpenWhiskBehavior" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Original OpenWhisk Behavior</h2> <p style="margin: 10px 0 0 0">Original behavior is according to this diagram:</p> <p style="margin: 10px 0 0 0"> <span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-external-resource" height="250" src="https://wiki.corp.adobe.com/download/attachments/1282180211/image2017-5-16%2015%3A10%3A55.png?version=1&amp;modificationDate=1494975254830&amp;api=v2" data-image-src="https://wiki.corp.adobe.com/download/attachments/1282180211/image2017-5-16%2015%3A10%3A55.png?version=1&amp;modificationDate=1494975254830&amp;api=v2"></span> </p> <p style="margin: 10px 0 0 0">In this workflow the execution of an activation is:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>queued in kafka topic associated with a specific invoker (there is some minimal logic here for allowing an action to have some affinity with a particular invoker, and spread actions across available invokers, etc)</li> 
<li>dequeued by the invoker IFF the existing in flight activations has dwindled to below some threshold (see ActivationFeed.pipelineFillThreshold)</li> 
<li>executed in a container AFTER&nbsp; 
<ul style="margin: 10px 0 0 0; margin-top: 0"> 
<li>the container is initialized, where initialization is required when: 
<ul style="margin: 10px 0 0 0; margin-top: 0"> 
<li>user namespace is different than the last one executed by this container</li> 
<li>OR the action is different than the last one executed by this container</li> 
<li>OR some initialization interval has elapsed since the last initialization</li> 
</ul> </li> 
<li>any previous activation is completed</li> 
</ul> </li> 
</ul> <p style="margin: 10px 0 0 0">Primary bottlenecks in throughput with this arrangement is&nbsp;<strong>per activation isolation</strong>. This means that even if the same user submits the same action for invocation (less likely, but not in all cases), the container usage is serialized so that a single activation is in flight at any given time. This is enforced by:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>queuing at multiple layers:<br> 
<ul style="margin: 10px 0 0 0"> 
<li>kafka</li> 
<li>ActivationFeed</li> 
<li>ContainerPool/ContainerProxy are singleton actors, where they process exactly 1 message at any time</li> 
</ul> </li> 
<li>some action containers (e.g. nodejs6Action) generate errors when another activation arrives while an existing activation is in-flight.&nbsp;</li> 
</ul> <p style="margin: 10px 0 0 0">Secondary complications are:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>kafka - not as much of a bottleneck, but a complication when used in a blocking or realtime request/response workflow, since scaling throughput via kafka is affected by: 
<ul style="margin: 10px 0 0 0; margin-top: 0"> 
<li>additional network hops/serdes/etc - the overhead of just transmitting data to a separate system</li> 
<li>scaling out consumption of messages is affected by partitioning scheme, and it will be hard to predict a scheme that will suit dynamically changing http traffic patterns</li> 
</ul> </li> 
<li>log processing - the logs are collected and persisted with each activation run; this is not done in blocking fashion so should not affect latency, but does affect throughput</li> 
</ul> <p style="margin: 10px 0 0 0">&nbsp;</p> <h2 id="UIDrivenUseCases-OpenWhiskusecases" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">OpenWhisk use cases</h2> <p style="margin: 10px 0 0 0">Currently OpenWhisk offers both</p> 
<ul style="margin: 10px 0 0 0"> 
<li> <strong>event driven useage</strong>&nbsp;- where a system can "fire and forget" a trigger, either automatically via schedule, or an HTTP endpoint where the client does not wait for a response.</li> 
<li> <strong>UI driven usage</strong>&nbsp;- where an action is invoked as part of an HTTP workflow that is driven by a user who is waiting for a response, such as:</li> 
</ul> 
<ul style="margin: 10px 0 0 0"> 
<li> 
<ul style="margin: 10px 0 0 0; margin-top: 0"> 
<li>dependent API usage in customer apps</li> 
<li>browser based app usage</li> 
</ul> </li> 
</ul> <p style="margin: 10px 0 0 0">These "realtime API usages" are cases where latency fluctuation based on concurrent loads is not tolerable, compared to event processing cases where an additional&nbsp;<em>n</em>&nbsp;seconds of latency during peek event generation is not noticeable, in most cases, and in many cases the response is not ever seen by the event producer (sensor data collection, etc). The specific differences between UI and event-driven cases are listed below:</p> 
<div class="table-wrap" style="margin: 10px 0 0 0; overflow-x: auto"> 
<table class="confluenceTable" style="border-collapse: collapse; border: 1px solid #ddd;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; border-collapse: collapse; margin: 10px 0 0 0; overflow-x: auto; margin-top: 0"> 
<tbody> 
<tr> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold">&nbsp;</th> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold"><span>UI driven use case</span></th> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold">event driven use case</th> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">blocking parameter</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>always</strong> used</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>sometimes</strong> used</td> 
</tr> 
<tr> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">desired timeout behavior</td> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>504 response</strong> - response will never be provided</td> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>202 response</strong> - response will be provided later</td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">activation concurrency</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>often</strong> concurrent with activations of the same action (to support scaleout independent of container resources)</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>never</strong> concurrent with other activations</td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">action container life cycle</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>always</strong> reused (without re-initialization)</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>may</strong> be reused (only for same action+subject)</td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">comparison to conventional web application life cycle <br>(start once, serve many requests)</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"> <p style="margin: 10px 0 0 0; margin-top: 0"> <strong>same</strong> as conventional web application</p> 
<ul style="margin: 10px 0 0 0; margin-left: 0; padding-left: 22px"> 
<li>start web application</li> 
<li>process many requests concurrently</li> 
<li>stop web application (only for deploy of new action container, idle for some period)</li> 
</ul> </td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"> <p style="margin: 10px 0 0 0; margin-top: 0">more like:</p> 
<ul style="margin: 10px 0 0 0; margin-left: 0; padding-left: 22px"> 
<li>start web application,</li> 
<li>process single request, (or a sequence of single requests, for same action+subject)</li> 
<li>stop web application</li> 
</ul> </td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">affects on container resource requirements</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"> <p style="margin: 10px 0 0 0; margin-top: 0">number of containers required is</p> 
<ul style="margin: 10px 0 0 0; margin-left: 0; padding-left: 22px"> 
<li> <strong>directly</strong> bound to the number of unique actions, and</li> 
<li> <strong>indirectly</strong> bound to the number of concurrent users (<strong>only for horizontal scaling, same as a web server</strong>)</li> 
</ul> </td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"> <p style="margin: 10px 0 0 0; margin-top: 0">number of containers required is</p> 
<ul style="margin: 10px 0 0 0; margin-left: 0; padding-left: 22px"> 
<li> <strong>directly</strong> bound to the number of unique actions, and</li> 
<li> <strong>directly</strong> bound to the number of concurrent users</li> 
</ul> </td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">log collection</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>cannot harvest logs for activations as part of activation processing</strong> - log collection must be performed at an aggregate level, and made available to developers via query tools</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left"><strong>can harvest logs for storage as part of activation processing - </strong>since each run will leave the container in a state where the most recent logs are associated with the most recent activation run</td> 
</tr> 
</tbody> 
</table> 
</div> <p style="margin: 10px 0 0 0">&nbsp;</p> <h2 id="UIDrivenUseCases-ProposedOpenWhiskBehavior" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Proposed OpenWhisk Behavior</h2> <p style="margin: 10px 0 0 0">In general, this proposal presents an&nbsp;<strong>option</strong>&nbsp;for UI driven activation processing for enabling realtime API consumption cases like:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>using OpenWhisk as an extension point for existing APIs that service user facing applications, where these APIs have a significant number of concurrent users</li> 
<li>using OpenWhisk as a system for implementing APIs that serve content to browser/mobile UI applications for a significant number of concurrent users</li> 
</ul> <p style="margin: 10px 0 0 0">Proposal for using http for activation transport is below:</p> <p style="margin: 10px 0 0 0"> <span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image confluence-external-resource" height="250" src="https://wiki.corp.adobe.com/download/attachments/1282180211/image2017-5-16%2015%3A51%3A26.png?version=1&amp;modificationDate=1494975254717&amp;api=v2" data-image-src="https://wiki.corp.adobe.com/download/attachments/1282180211/image2017-5-16%2015%3A51%3A26.png?version=1&amp;modificationDate=1494975254717&amp;api=v2"></span> </p> <h3 id="UIDrivenUseCases-Importantpoints:" style="margin: 10px 0 0 0; font-size: 16px; line-height: 25px; margin: 30px 0 0 0">Important points:</h3> 
<ul style="margin: 10px 0 0 0"> 
<li>Enabling http routing (from controller to container) should be OPTIONAL (and is different from existing&nbsp;<em>blocking=true&nbsp;</em>parameter or&nbsp;<em>--web&nbsp;</em>annotation)&nbsp;; could be based on: 
<ul style="margin: 10px 0 0 0"> 
<li>an annotation on the action (requires logic be added to the action containers to conditionally tolerate concurrent activations)</li> 
<li>a different/unique action type</li> 
</ul> </li> 
<li>Multiple activations for the SAME action can be serviced by a single shared container concurrently</li> 
<li>Additional logic MAY be added to treat an existing shared container as &nbsp;"at capacity" once a certain number of outstanding concurrent requests is reached (at which point additional containers should launch to share load)</li> 
<li>Invoker will advertise the container state(s) to the controller (in addition to the health status, which already happens)</li> 
<li>Controller can route activation directly to a container once the action is resolved (skipping kafka and invoker)</li> 
<li>Invoker is still responsible for handling all cold-start use cases (where no existing container exists, or not enough to handle load)*<br> <br> </li> 
</ul> <p style="margin: 10px 0 0 0">&nbsp;<em>* Although extending the Controller LoadBalancer component to leverage a clustering system instead of "a set of Invokers" should also be optional and have the same affects on throughput.&nbsp;</em> </p> <h3 id="UIDrivenUseCases-Benefits:" style="margin: 10px 0 0 0; font-size: 16px; line-height: 25px; margin: 30px 0 0 0">Benefits:</h3> 
<ul style="margin: 10px 0 0 0"> 
<li>Increased throughput for traffic patterns that are "UI driven" use cases: 
<ul style="margin: 10px 0 0 0; margin-top: 0"> 
<li>high volume of unique users (10k+ concurrent users)</li> 
<li>comparatively low volume of unique actions (&lt;1000 unique actions)</li> 
</ul> </li> 
<li>Resource requirements based<strong>&nbsp;only on number of unique actions*</strong> <br> <br> </li> 
</ul> <p style="margin: 10px 0 0 0"> <em>*Until saturating capacity is reached based on similar deployment of the same technology as "a conventional web application wrapped in a container" - e.g. if I can deploy a conventional nodejs application deployed as a container to service 4000 concurrent user, I should be able to implement an action that services similar traffic, using a&nbsp;<strong>single</strong>&nbsp;container within the OpenWhisk system</em> </p> <h2 id="UIDrivenUseCases-Isolationdetails" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Isolation details</h2> <p style="margin: 10px 0 0 0">This proposal purposefully decreases isolation for the gain of throughput. It is true that this exposes action developers to risks such as:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>leaking "session" data across different activations</li> 
<li>incorrectly blocking code affects many users instead of just one</li> 
<li>incorrect estimation of resource usage</li> 
</ul> <p style="margin: 10px 0 0 0">However, these are the same risks that web developers take when building conventional web applications, so generally developers should not be averse to these issues.&nbsp;</p> <h2 id="UIDrivenUseCases-ResourceRequirementsEstimation" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Resource Requirements Estimation</h2> <p style="margin: 10px 0 0 0">The area of "incorrect resource usage estimation" is one where <strong>any</strong> container based applications are susceptible to starvation (<em>"I thought my app/function would only require 128m"</em>) - this does not change with this proposal, except that it is somewhat simpler to simulate a single user for measurements used for estimation. Estimating resource requirements is a challenge regardless of whether the application is built into a custom container, running as actions in OpenWhisk, and servicing 1 user or 100 users. There are areas where we can help, such as:</p> 
<ul style="margin: 10px 0 0 0"> 
<li>Provide multiple pre-warmed container instances - this may be wasteful, but is a way to provide some guarantees around availability under load, and less expensive than 1-container per action requirement of old scheme when under heavy concurrent load</li> 
<li>Collect and expose data on OOM killer encounters from docker containers that may be masked by mesos/marathon in general, so that devs can tune the system based on usage over time, even in an automated way in some cases. This is arguably required anyways, but is less likely to be an issue for single-concurrent-user usage of a container.</li> 
</ul> <h2 id="UIDrivenUseCases-SampleData" style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 30px; margin: 40px 0 0 0">Sample Data</h2> <p style="margin: 10px 0 0 0">In a simple prototype, creating load using the&nbsp;<a class="external-link" href="https://github.com/markusthoemmes/openwhisk-performance" rel="nofollow" style="color: #3b73af; text-decoration: none">https://github.com/markusthoemmes/openwhisk-performance</a>&nbsp;throughput.sh test, throughput increases tested locally (default configs except for extended throttling limits) were measured at metrics below. This test used a simple async action that produces a result after 175ms, to simulate waiting for a downstream external API to return, which would be a common scenario for actions that service UI driven use cases:</p> 
<div class="code panel pdl" style="border-width: 1px;"> 
<div class="codeContent panelContent pdl"> 
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;; margin: 10px 0 0 0; margin-top: 0">function main(params) {
    console.log("testing async-noop.js");
    return new Promise(function (resolve, reject) {
        setTimeout(function () {
            resolve({done: true});
        }, 175);
    })
}</pre> 
</div> 
</div> 
<div class="table-wrap" style="margin: 10px 0 0 0; overflow-x: auto"> 
<table class="confluenceTable" style="border-collapse: collapse; border: 1px solid #ddd;; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; border-collapse: collapse; margin: 10px 0 0 0; overflow-x: auto; margin-top: 0"> 
<tbody> 
<tr> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold">&nbsp;</th> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold">original deployment</th> 
<th class="confluenceTh" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;background-color: #F0F0F0; font-weight: bold;; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left; background-color: #f0f0f0; font-weight: bold">http activation processing approach</th> 
</tr> 
<tr> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">mean latency</td> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">8642.7 ms</td> 
<td class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">915.1 ms</td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">requests per second</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">11</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">102</td> 
</tr> 
<tr> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">number of action containers</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">2</td> 
<td colspan="1" class="confluenceTd" style="border: 1px solid #DDD; padding: 5px 7px; min-width: 0.6em; text-align: left; vertical-align: top;; padding: 0px; border-collapse: collapse; border: 1px solid #ddd; padding: 7px 10px; vertical-align: top; text-align: left">1</td> 
</tr> 
</tbody> 
</table> 
</div> <p style="margin: 10px 0 0 0">&nbsp;</p> <p style="margin: 10px 0 0 0">&nbsp;</p> <p style="margin: 10px 0 0 0">&nbsp;</p> <p style="margin: 10px 0 0 0">&nbsp;</p> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-main mobile-expand action-padding last-row-padding" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 15px 16px; background-color: #fff; padding-bottom: 10px; padding-bottom: 10px"> 
<table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
<tbody> 
<tr> 
<td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 15px 0 0 24px; vertical-align: middle"> 
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"><a href="https://cwiki.apache.org/confluence/display/OPENWHISK/UI+Driven+Use+Cases?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=view" title="View page Icon" style="color: #3b73af; text-decoration: none"><img class="actions-pattern-action-icon-image" height="16" width="16" border="0" title="View page Icon" src="cid:com.atlassian.confluence.plugins.confluence-email-resources_view-page-email-adg-footer-item_icon" alt="View page Icon" style="vertical-align: middle"></a></td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px; white-space: nowrap"><a href="https://cwiki.apache.org/confluence/display/OPENWHISK/UI+Driven+Use+Cases?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=view" title="View page" style="color: #3b73af; text-decoration: none">View page</a></td>
<td class="actions-pattern-action-bull" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; color: #999; padding: 0 5px">•</td> 
</tr> 
</tbody> 
</table> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"><a href="https://cwiki.apache.org/confluence/plugins/likes/like.action?contentId=71013305&amp;src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=like" title="Like Icon" style="color: #3b73af; text-decoration: none"><img class="actions-pattern-action-icon-image" height="16" width="16" border="0" title="Like Icon" src="cid:com.atlassian.confluence.plugins.confluence-like_view-email-adg-content-item_icon" alt="Like Icon" style="vertical-align: middle"></a></td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px; white-space: nowrap"><a href="https://cwiki.apache.org/confluence/plugins/likes/like.action?contentId=71013305&amp;src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=like" title="Like" style="color: #3b73af; text-decoration: none">Like</a></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; height: 5px; line-height: 5px; padding: 0 15px 0 16px; background-color: #fff; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; border-top: 0; border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; mso-line-height-rule: exactly">&nbsp;</td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
<table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="footer-pattern-links-container" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<tbody> 
<tr> 
<td class="footer-pattern-links mobile-resize-text" style="padding: 0px; border-collapse: collapse"><a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=OPENWHISK&amp;src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=stop-watching" title="" style="color: #3b73af; text-decoration: none">Stop watching space</a></td>
<td class="footer-pattern-links-bull" style="padding: 0px; border-collapse: collapse; padding: 0 5px; color: #999">•</td> 
</tr> 
</tbody> 
</table> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
<tbody> 
<tr> 
<td class="footer-pattern-links mobile-resize-text" style="padding: 0px; border-collapse: collapse"><a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action?src=mail&amp;src.mail.timestamp=1498921577983&amp;src.mail.notification=com.atlassian.confluence.plugins.confluence-content-notifications-plugin%3Apage-created-notification&amp;src.mail.recipient=8aa980875bf24635015c9267bc8e02f6&amp;src.mail.action=manage" title="" style="color: #3b73af; text-decoration: none">Manage notifications</a></td> 
</tr> 
</tbody> 
</table> </td>
<td id="footer-pattern-logo-desktop-container" rowspan="2" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333"> 
<tbody> 
<tr> 
<td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"><img id="footer-pattern-logo-desktop" src="cid:footer-desktop-logo" alt="Confluence logo big" title="Confluence logo big" width="132" height="20" class="image_fix"></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
<tr> 
<td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px; display: none">This message was sent by Atlassian Confluence 5.8.17<br> <img id="footer-pattern-logo-mobile" src="cid:footer-mobile-logo" alt="" title="" width="0" height="0" style="display: none; mso-hide: all"></td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
</table> 
<table id="sealed-section" border="0" cellpadding="0" cellspacing="0" width="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; color: #333; display: none"> 
<tbody> 
<tr> 
<td style="padding: 0px; border-collapse: collapse; border: 0; font-size: 0px; line-height: 0; mso-line-height-rule: exactly"></td> 
</tr> 
</tbody> 
</table>
</body>
</html>
Mime
View raw message