Trying to follow a clean architecture with a feature-based folder structure
Following https://www.rfc-editor.org/rfc/rfc7518#section-3.
openssl ecparam -name secp384r1 -genkey -noout -out jwt_private_key.pemUseful environment variables
OTEL_EXPORTER_OTLP_ENDPOINT
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
OTEL_BSP_SCHEDULE_DELAY
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
OTEL_METRIC_EXPORT_INTERVAL- Click on the configuration on the top right
- Edit Configurations...
- In the Run section, click on Modify, then click on Environment variables and add the needed values
- In the Run section, click on Modify, then click on Run options and add the network of the PostgreSQL container with
--network <app-db-network>
Needs environment variables to be set.
- Settings
- Tools
- Terminal
- Environment Variables under the Project Settings section
cd ./src/backend/Persistence
dotnet ef migrations add InitialMigration --project Persistence.csproj --startup-project ../WebAPI/WebAPI.csproj
dotnet ef database update --project ./Persistence.csproj --startup-project ../WebAPI/WebAPI.csproj cd ./src/backend/Persistence
dotnet ef migrations script --project ./Persistence.csproj --startup-project ../WebAPI/WebAPI.csproj --idempotent --output migrations.sql
# docker network mode host when running the API in a container on the same host
docker run --rm --network host -v ./scripts/k6/test_api_weightentry_get.js:/var/lib/test.js grafana/k6 run /var/lib/test.js # --env HOST=http://localhost:8080 --env URL_PATH=/api/v1/weightentry --env RPS_TARGET=1000From profiling and testing it seems like the application becomes CPU bottlenecked when the User Create end point is called. After profiling, it seems to be caused by the Pbkdf2PasswordHasher.
In particular the Rfc2898DeriveBytes.Pbkdf2 call is really expensive on the CPU.