MSDGen generates microservice demos of any given size and connectivity constraints.
msdgen | kubectl apply -f-
MSD10(A generated demo with 10 services)
- Getting binary
- Getting started
- Adjusting service behaviors
- Changing size and connectivity
- Operating MSDn
We have pre-built binaries for MacOS, Linux and Windows on amd64 architecture. They can be found on the release page.
If you need binaries for other OSes or architectures, feel free to file an issue.
msdgen, you will get a MSD10
which are manifests of 10 connected services and a traffic generator as their client can be deployed on K8s clusters.
The connectivity layout is saved in a DOT file named
It can be converted to an image by
dot -Tpng foo.dot -o bar.png if you have graphviz installed.
If you have Istio and Kiali installed in cluster,
you will see a graph has the same connectivity layout to which shown in the dot file.
Each MSDn has only 1 entry service, it is called
gateway. Services are connected via HTTP protocol.
An MSDn also contains a client workload directly connects to the gateway service to generate traffic. Its name is
You can increase the client bandwidth by starting more concurrent client processors,
or waiting less time between queries in each processor, through
Every time you run
msdgen will generate a new MSDn with various connectivity even with same parameters.
But, all Deployments and Services deployed in a cluster can be filtered with label
You can easily delete all of them.
kubectl delete svc,deploy --wait -l origin=msdgen
Adjusting service behaviors
We provide a few options to coordinate service behaviors. This might enhance the similairty to real business.
-parallelenables concurrent queries to all upstream services instead of fetching each of them sequentially.
-longindicates that all queries to the same upstream are sent through the same L4 connection.
-timeoutis used to change the timeout of each upstream query.
-payload-sizesets the response body size of each downstream query.
-upload-sizechanges the upstream query body size and its method. The query method will be GET if the options is set to 0. Otherwize, POST instead.
These options are shared by all services. Once you need to change only particular services, corresponding environment variables can be found in generated manifests.
Changing size and connectivity
MSDGen generates service connectivity randomly. Specific connectivity definition for each service is not currently supported. Even though, you can still rule the randomness of MSDGen.
-serviceschanges the total number of services.
-max-versionsdefines the upperbound of the number of versions for each service.
-max-upstreamsets the upperbound of the number of upstreams for each service.
-max-downstreamsets the upperbound of the number of downstreams for each service.
-longest-call-chainlimits the number of services through which a query may walk. If the topology of an MSDn can be a tree with the
gatewayservice as its root,
-longest-call-chainsets its height.
MSDn is designed to use less CPU and memory, such that you can run a large scale of services on commodity computers. As we tested, each servise costs less than 10MiB memory if both payload size and upload data size are less than 1MiB. The CPU usage increases as the concurrent downstream size or the upstream size increasing, and finally less than 500m(1CPU=1000m).
We also provide two options to limit the CPU usage of each service,
If you need to change the number of service workload replicas,
-max-replicas will be its upperbound.
-namespaces is provided to randomly distribute services to different namespaces.