https://github.com/vensas/dotnet-container-gc
Example project to test memory and GC behavior of ASP.NET minimal API on Kubernetes
https://github.com/vensas/dotnet-container-gc
dotnet dotnet-core grafana k6 kubernetes opentelemetry prometheus
Last synced: 3 months ago
JSON representation
Example project to test memory and GC behavior of ASP.NET minimal API on Kubernetes
- Host: GitHub
- URL: https://github.com/vensas/dotnet-container-gc
- Owner: vensas
- Created: 2024-12-02T07:46:40.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-26T20:54:47.000Z (5 months ago)
- Last Synced: 2025-03-20T02:11:26.710Z (4 months ago)
- Topics: dotnet, dotnet-core, grafana, k6, kubernetes, opentelemetry, prometheus
- Language: C#
- Homepage:
- Size: 776 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dotnet Containerization and Garbage Collection
ℹ️ This example was put together on a Mac using a *nix shell scripts and [homebrew](https://brew.sh) and may not work in other environments.
## Motivation
The intention behind this project is to demonstrate the DATAS memory management optimization in .NET 9 (compared to .NET 8) and how to visualize them using OpenTelemetry.## Setup
### Install dependencies
```sh
brew install minikube kubectl kustomization k6
```### Run a local kubernetes cluster
```sh
minikube start --extra-config=kubelet.authentication-token-webhook=false --extra-config=kubelet.authorization-mode=AlwaysAllow
```*Note: To configure shell to use minikube docker environment, run*
```sh
eval $(minikube -p minikube docker-env)
```### Build the image
```sh
make build
```### Verify image is available
```sh
minikube image ls --format table
```### Setup test environment
```sh
kubectl apply -f ./kubectl/observability
```### Deploy service and expose endpoint
```sh
make serve_dotnet8 # for dotnet 8
make serve_dotnet9 # for dotnet 9
```Service is exposed on a random port on localhost. Copy URL and port printed out.
## Run Tests
### Install k6
```sh
brew install k6
```### Run k6 tests
```sh
k6 run k6/test.js -e MAX_USERS= -e BASE_URL
```### Access Grafana
```sh
make grafana
```Login using default user `admin` with password `admin`.
## Teardown
### Reset shell configuration
```sh
eval $(minikube docker-env --unset)
```