From dev-return-2804-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Sun Nov 18 13:28:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E2CC618066C for ; Sun, 18 Nov 2018 13:28:07 +0100 (CET) Received: (qmail 76852 invoked by uid 500); 18 Nov 2018 12:28:07 -0000 Mailing-List: contact dev-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list dev@openwhisk.apache.org Received: (qmail 76840 invoked by uid 99); 18 Nov 2018 12:28:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Nov 2018 12:28:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DFFF5180C68 for ; Sun, 18 Nov 2018 12:28:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.702 X-Spam-Level: X-Spam-Status: No, score=-0.702 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=messagingengine.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4Ey5d2-_uw8a for ; Sun, 18 Nov 2018 12:28:04 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6552A60E3A for ; Sun, 18 Nov 2018 12:28:04 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4FC5221593 for ; Sun, 18 Nov 2018 07:27:58 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute2.internal (MEProxy); Sun, 18 Nov 2018 07:27:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=DNQZTQ uaGKJBpbdII4Jotbaumxmf3TrMj/SjgDRDlzw=; b=OyhZDS9eiBtgVr+IOrEIfK FvX2B/JPb4UmPKnT6F6/HzWfFa6s1pNyehRsBM9cNUDT/FFrXJzPU5wEgKOQNl4a j68zGOZpnFJIuUdtBOa17MmEOEMoO3iokcsUDfYztxvW7fv4BTMRKa0yLa9fIqNC VCpK0KVeDTQ1NWqpzmUhV0jfiY+A1bqM1MO+XwzdFmgMKeRU8ZuX7od042huTOxQ 4cs7tJ3N8Hjd6Db0jxU0AfBx0wGD/0xKNovwm28nNzpfOH2kvbo+eMValPiGyOhP Y48AE6PQN9LMyilvOvLOJgTe5684+xvX31tRn+BVx83HfqGCnfY7CakhpJKog2Aw == X-ME-Sender: X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 99) id DE6049E49A; Sun, 18 Nov 2018 07:27:57 -0500 (EST) Message-Id: <1542544077.2995236.1580821616.487E419E@webmail.messagingengine.com> From: Michele Sciabarra To: dev@openwhisk.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-2d882eb6 Subject: The ActionLoop based runtime for Python3.6 for OpenWhisk is 5 times faster than the current runtime Date: Sun, 18 Nov 2018 13:27:57 +0100 Hello all, before commenting, here there are the numbers: *** Testing OpenWhisk Classic Python *** Running 1m test @ http://localhost:8080/run 1 threads and 1 connections Thread Stats Avg Stdev Max +/- Stdev Latency 49.91ms 2.33ms 60.23ms 79.28% Req/Sec 19.87 2.58 30.00 93.59% 1202 requests in 1.00m, 148.01KB read Requests/sec: 20.03 Transfer/sec: 2.47KB *** Testing ActionLoop Python *** Running 1m test @ http://localhost:8080/run 1 threads and 1 connections Thread Stats Avg Stdev Max +/- Stdev Latency 11.77ms 673.30us 37.85ms 93.85% Req/Sec 85.14 5.56 90.00 84.25% 5101 requests in 1.00m, 632.64KB read Requests/sec: 84.95 Transfer/sec: 10.54KB What is this? For those who are new to the list, I recap a bit. I am the author of the runtime for Go. Because Go is a compiled language, I implemented a different approach than the other languages. Other runtimes are build in the target language, they implement the runtime an and load the code in a way "language dependent" In the Go runtime, your action is a full featured standalone executable, and it communicates with the proxy via pipes and I/O. The runtime evolved in a compete infrastructure to implement actions in ANY programming language that can read input and write output line by line and parse JSON. It was designed for compiled programming language (Go, but also C/C++, Rust, Haskell, Nim) but there is nothing preventing to use it with scripted languages: Python for example. Building a runtime using the current infrastructure, is extremely easy: you just need a Dockerfile, a "compiler" and a launcher. I already built the support for Go, Swift, an experiment using Scala and now I created one for Python. It took me 2 hours today to build the runtime. Working a bit on it. it could even became easier. There is now a "compiler" script, it could be just a "json" descriptor... Then I decided to benchmark the result. I created a very simple "main.py" (just the classic "hello") and I used the "wrk" tool to benchmark the "raw" http performance, executing one single thread with one connection. The result is what you can see before. The current runtime can perform, using Docker on my Mac, 1202 requests in one minute, while the runtime built with ActionLoop can perform 5101 requests in one minute. I am not entirely surprised because the current runtime uses a Python based HTTP support, while the ActionLoop is entirely native code and it communicate the action over (internally optimized) I/O. Code is here: https://github.com/sciabarracom/incubator-openwhisk-runtime-actionloop So, is it worth to use this as an "official" way to write runtimes? In such a case I can document all the procedure... There was some discussion of using it as the "dockerskeleton v2". Not sure if the name is suitable, also the concept is a bit different although it is very generic. I would like more something like "runtime-sdk" or something like this. Let me know your thoughts. -- Michele Sciabarra michele@sciabarra.com