Code Monkey home page Code Monkey logo

proxywasm-memory-test's Introduction

proxywasm-memory-test

The memory problem in Proxywasm + Tinygo + Envoy

Dependencies

  • Go v1.21.4
  • tinygo v0.30.0
  • nottinygc v0.7.0
  • proxy-wasm-go-sdk v0.22.0
  • Envoy v1.28

Setup

The project contains a simple envoy-sidecar wasm that create an array or bytes of size 10485760 for each request. To build the wasm file and run envoy use the following commands:

tinygo build -o plugin.wasm -scheduler=none -target=wasi -no-debug -gc=custom -tags="custommalloc nottinygc_envoy" .
docker-compose up --build

Tests

Here is a script that sends 120 requests with 10 threads within 12 seconds, then wait for 20 seconds, and repeat this iteration 5 times.

Test script requires hey but can be done with wrk or other tools.

set HEY_PATH={HEY_PATH}\hey.exe
.\run.cmd

or

./run.sh

Results

When running tests for 5 iterations and looking to the memory usage inside docker (with tools like top or docker-desktop resource usage), after each iteration, we found that the memory increased, but after finishing the test, it be never released.

The results show that the RES memory is increasing and never decreased even after sending requests stopped. Also, it shows that in some cases, when a new iteration starts, the memory gets increased.

{
 "allocated": "15867936",
 "heap_size": "31457280",
 "pageheap_unmapped": "0",
 "pageheap_free": "4661248",
 "total_thread_cache": "10068560",
 "total_physical_bytes": "35057510"
}

1


{
 "allocated": "16991256",
 "heap_size": "31457280",
 "pageheap_unmapped": "0",
 "pageheap_free": "3252224",
 "total_thread_cache": "10214792",
 "total_physical_bytes": "35069846"
}

2


{
 "allocated": "17154592",
 "heap_size": "31457280",
 "pageheap_unmapped": "0",
 "pageheap_free": "2940928",
 "total_thread_cache": "10404576",
 "total_physical_bytes": "35071334"
}

3


{
 "allocated": "17154904",
 "heap_size": "31457280",
 "pageheap_unmapped": "0",
 "pageheap_free": "2891776",
 "total_thread_cache": "10429320",
 "total_physical_bytes": "35071622"
}

4

proxywasm-memory-test's People

Contributors

behnamnikbakht avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.