Memory Usage of OpenWhisk Functions
If you've heard about Red Hat's Quarkus, you'll want to see the results of this memory experiment.
Join the DZone community and get the full member experience.Join For Free
last week red hat introduced the open source framework quarkus which promises fast boot times and low memory usages. this makes quarkus interesting for java workloads running as serverless functions.
note: this is just a quick experiment. i haven't measured the actual memory in the cloud, i haven't created much load, the functions don't really do anything, etc.
i compare four different types of functions:
- java functions as openwhisk provides them out of the box
- java functions using quarkus
i've open sourced the code and the scripts. get the code.
you can run the functions in the cloud on ibm cloud functions and measure the time it takes to execute them. in my quick tests, all of them took roughly the same amount of time once the containers were warm. also the functions only implement echo functionality, which is why it doesn't make much sense to measure the execution times of these functions.
that's why i focussed on memory usage. since i'm not aware of any way to measure the memory on ibm cloud functions, i've set up openwhisk locally . i hadn't done this before, but it was really easy and didn't take longer than 10 minutes. this allows you to run the same containers locally that are run in the cloud.
in order to run the tests yourself, follow the steps in the readme . you need to install some prerequisites and build the images. after this you can create the four functions via some scripts i've provided. i create the functions with a memory limit of 128 mb which is the smallest possible configuration .
in order to see the memory usage, i've used the 'docker stats' command. here are the results:
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.