Skip to content

Latest commit

 

History

History
 
 

fibonacci

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Fibonacci Benchmark

The Fibonacci benchmark runs the code to generate a fibonacci sequence. For more information on fibonacci sequence see the Wikipedia page for it.

The same functionality is implemented in different runtimes, namely Python, NodeJS and golang.

Running this benchmark locally (using docker)

The detailed and general description how to run benchmarks local you can find here. The following steps show it on the fibonacci-python function.

  1. Build or pull the function images using make all-images or make pull.

Invoke once

  1. Start the function with docker-compose
    docker-compose -f ./yamls/docker-compose/dc-fibonacci-python.yaml up
  2. In a new terminal, invoke the interface function with grpcurl.
    ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello

Invoke multiple times

  1. Run the invoker
    # build the invoker binary
    cd ../../tools/invoker
    make invoker
    
    # Specify the hostname through "endpoints.json"
    echo '[ { "hostname": "localhost" } ]' > endpoints.json
    
    # Start the invoker with a chosen RPS rate and time (With relay)
    ./invoker -port 50000 -dbg -time 10 -rps 1

Running this benchmark (using knative)

The detailed and general description how to run benchmarks on knative clusters you can find here. The following steps show it on the fibonacci-python function.

  1. Build or pull the function images using make all-images or make pull.
  2. Start the function with knative
    kn service apply -f ./yamls/knative/kn-fibonacci-python.yaml
  3. Note the URL provided in the output. The part without the http:// we'll call $URL. Replace any instance of $URL in the code below with it.

Invoke once

  1. In a new terminal, invoke the interface function with test-client.
    ./test-client --addr $URL:80 --name "Example text for Fibonacci"

Invoke multiple times

  1. Run the invoker
    # build the invoker binary
    cd ../../tools/invoker
    make invoker
    
    # Specify the hostname through "endpoints.json"
    echo '[ { "hostname": "$URL" } ]' > endpoints.json
    
    # Start the invoker with a chosen RPS rate and time
    ./invoker -port 80 -dbg -time 10 -rps 1

Tracing

This Benchmark supports distributed tracing for all runtimes. For the general use see vSwarm docs for tracing locally and with knative.