/faas-example

Example project for simulating FaaS

Primary LanguagePython

FaaS - Simple implementation of a Function as a Service

Example application for demonstrating simple functions that get executed asynchronously in a separate process.

In event where no process is available, a new is created.

Install:

pip install requirements.txt

Run Server:

python ./faas-example.py

Send a single message:

curl -H 'Content-Type: application/json' -X POST --data '{"message": "xyz"}' http://localhost:8000/messages

Run multiple concurrent requests:

for i in {1..100}; do curl -H 'Content-Type: application/json' -X POST --data '{"message": "xyz-'$i'"}' http://localhost:8000/messages & done

To read function invocation statistics:

$ curl http://localhost:8000/statistics
{"active_instances": 12, "total_invocations": 150, "max_workers": 14}

Logs can be read from file: faas-example.log