Posts
My Restful API Specification
· β˜• 2 min read
Mainly for standardizing the APIs I write myself, and also to help LLMs understand my APIs better. 1. Domain Use a dedicated domain whenever possible, for example api.example.com. 2. Path Always use lowercase letters. Do not include an /api prefix. Do not include file extensions. Do not put / at the end.

OpenAI Vs Azure OpenAI API
· β˜• 3 min read
Because pricing and limits change over time, this article is only a reference for the time it was written. 1. Terminology RPM (requests per minute) Requests per minute RPD (requests per day) Requests per day TPM (tokens per minute) Tokens per minute TPD (tokens per day), Tokens per day

EnvoyFilter Configuration in Istio
· β˜• 4 min read
1. What Is EnvoyFilter EnvoyFilter is a CRD resource in Istio that allows users to modify Envoy’s configuration to satisfy their customization needs for different scenarios. 1 2 3 4 5 6 7 8 9 kubectl get envoyfilter -A NAMESPACE NAME AGE istio-system add-request-id-into-ingressgateway 54d istio-system compression-gzip 18d istio-system custom-access-log 3d istio-system ingressgateway-settings 52d istio-system preserve-request-header-us-test-ingress-gateway 95d istio-system preserve-x-request-id 54d When using Istio, you will usually end up using at least a few EnvoyFilters.

Optimizing Go Applications in Containers
· β˜• 3 min read
1. Memory Alignment Arrange the fields inside a struct from largest to smallest. This reduces memory footprint. Install the fieldalignment tool 1 go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest Analyze and fix memory alignment 1 2 3 4 5 6 7 8 9 fieldalignment -fix ./... /Users/shaowenchen/Code/app/config/config.go:136:14: struct with 32 pointer bytes could be 24 /Users/shaowenchen/Code/app/config/config.

Installing and Initializing a PCI SSD
· β˜• 2 min read
1. Check the PCI Interface Device Use lspci to check whether the device is already installed. 1 2 3 lspci |grep storage d8:00.0 Mass storage controller: Shannon Systems Device 2275 Here a Shannon Systems device shows up, which means the SSD is already installed. 1 2 3 4 5 6