Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4D37B200C15 for ; Wed, 8 Feb 2017 14:27:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4BBF8160B5A; Wed, 8 Feb 2017 13:27:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 947FB160B4E for ; Wed, 8 Feb 2017 14:27:57 +0100 (CET) Received: (qmail 24149 invoked by uid 500); 8 Feb 2017 13:27:56 -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 24132 invoked by uid 99); 8 Feb 2017 13:27:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 13:27:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E912DC05D7 for ; Wed, 8 Feb 2017 13:27:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id NqE9_VwcyVey for ; Wed, 8 Feb 2017 13:27:52 +0000 (UTC) Received: from mail-yb0-f180.google.com (mail-yb0-f180.google.com [209.85.213.180]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 925FF5F613 for ; Wed, 8 Feb 2017 13:27:51 +0000 (UTC) Received: by mail-yb0-f180.google.com with SMTP id o65so45494888ybo.2 for ; Wed, 08 Feb 2017 05:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=LKCF9qU3Euf8qlY6jIoANs8DR+v43cqU7BBPQ7NLZlA=; b=aA4zsDywqCPehWDvC2XfX8a/6ltVXz9YI3pvt9RsvfoZNyyl6XTUrupou2rELBOhsB kRLodGGrg+NnXfJ8ykTOhDyv3CFaK1tGGN1Mp9RNYonhnaRxM59Shz6gJF3Lmf7GUiWI PzwKFXASYQtucIeP+4I/uFxKGF5O/E/97OsOoXSx/wZ56ssO50BI6rfRcTNzFFh5D9eS ERNiihdlQfr7uMMkqEU9buv5EBM7ZiDdUmW7kq0WqN2C9jW5Cchh2zytYqdtormfCu82 tu+iDYXS7aRAb3zTUrU/ZtG5kL0+cfDrC2Ul8JeMZNOASJ5sogzmibFTGskj3o9qOW41 AN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LKCF9qU3Euf8qlY6jIoANs8DR+v43cqU7BBPQ7NLZlA=; b=PboCRw9kcCNyO66bUx0OloFR/Cojg4ZenKeroX3QDHRCc0OvTv/ZA0/0qUuHz3Q+Ww PC6NWVqgNwBlXQmQRJIbqF60xiqgUFwWcPmipQx7Z6KkrJXTccPwftAOMGk+55tqC4Ov qK7km5qFk9pqKf8UwD7J+SK5mWPi7Uu0m2FK/IX6qjMUTpFx+ONZJq0BS5S3Qv2Tq8Ew 2MToXJJ/Fx5giXFD/LLNFTHo70l93nfp48lvHScjux2UzURd0htrc3HOS4vu0xVXmrDu o9gzp/K0ZPKYPdX6w6/1vnO9uurGQ7prkeWdQa1pQ3o54qDW5pUwiMX6mmlxOtWAZMm9 ycGA== X-Gm-Message-State: AMke39nm7QGItO03hDHHbtcJiB3vMHvSPVRLC+7dXGe12zwzxMpyVZGUGRyddJ+2WTSWDbD5QDHNIaHsi1MG8A== X-Received: by 10.37.161.234 with SMTP id a97mr14809202ybi.163.1486560470434; Wed, 08 Feb 2017 05:27:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.95.139 with HTTP; Wed, 8 Feb 2017 05:27:50 -0800 (PST) From: Jeremias Werner Date: Wed, 8 Feb 2017 14:27:50 +0100 Message-ID: Subject: Exposing garbage collector for nodejs runtime To: dev@openwhisk.apache.org Content-Type: multipart/alternative; boundary=f403045c6482c7129b054804d498 archived-at: Wed, 08 Feb 2017 13:27:58 -0000 --f403045c6482c7129b054804d498 Content-Type: text/plain; charset=UTF-8 Hi, I would like to get opinions and ideas on a finding and proposed solution for memory intensive nodejs actions that I found during debugging of a related issue. *Problem Statement* The problem is that the node js problem does not seem to have enough idle time in a serverless world to run garbage collector. That can be seen by running a 512MB action that allocates and free 128MB memory. As a result you can see that every 5th invocation run into an application developer error because OW's DOS protection kills the container at the 512MB limit. (disclaimer: the action is a very synthetic action doing nothing else which might reduce the time for the GC to jump in, like downloading a video/image, ...) You can see the details in the following PR: https://github.com/openwhisk/openwhisk/pull/1826 *Implemented MVP in the PR:* Run the node js process by default with "--expose-gc" and give the user the chance to force garbage collection in memory intensive actions. Document and/or blog about the use case. *Advanced Proposal 1* We could run the garbage collector anytime after the user code has been executed in our nodejs skeleton app. This would result in a constant 30ms overhead on top of the users action (see experiment in PR) *Advanced Proposal 2* Automatically detect memory intensive actions by gathering the memory consumption on the node process and force the GC if necessary *Advanced Proposal 3* Provide a flag in the create action API to define whether the GC should be enforced for the action. Feedback / comments welcome! kind regards, Jeremias Werner --f403045c6482c7129b054804d498--