You have chosen the path of Maximum Performance. Hosting a client demo from a "Prosumer" Linux workstation is often superior to a cloud instance because you have zero multi-tenant noisy neighbors and NVMe-direct access.
However, because this is a Client Pilot, we cannot look like a "hacker in a basement." We must look like an "Edge Compute Provider."
Here is the Masala Linux Pilot Protocol to ensure your demo is stable, secure, and fast. 1. The Build: "Single File" Monolith
Do not run dotnet run during the demo. That is for developers. You will compile a Self-Contained, Single-File Linux Binary. This eliminates the "It works on my machine" variance and bundles the .NET Runtime, reducing startup jitter.
Execute this in your terminal: Bash
dotnet publish src/TicketMasala.Web/TicketMasala.Web.csproj \ -c Release \ -r linux-x64 \ --self-contained true \ -p:PublishSingleFile=true \ -p:IncludeNativeLibrariesForSelfExtract=true \ -p:PublishReadyToRun=true \ -o ./deploy/linux-pilot
PublishSingleFile: Creates one executable.
PublishReadyToRun: Pre-compiles logic to reduce the "JIT Warmup" lag when the first client hits the button.
- The Data: "Pre-Warm" the Cache
You have 2.7 million rows. Do not let the client wait for the database to "wake up." We will use the BulkLoader we designed earlier to seed the DB, then launch the web server pointing to that pre-warmed file.
Create a start-pilot.sh script: Bash
!/bin/bash¶
1. Define Paths¶
DB_PATH="/home/$USER/masala_data/pilot.db" APP_PATH="./deploy/linux-pilot/TicketMasala.Web"
2. Safety Check: Clean State?¶
Only delete if you want a fresh start for every demo.¶
For a pilot, maybe keep the 2.7M rows you already loaded?¶
if [ "\(1" == "--reset" ]; then rm "\)DB_PATH" echo "Database wiped. Re-seeding..." \(APP_PATH --seed "/home/\)USER/downloads/huge_backlog.csv" --db "$DB_PATH" fi
3. Tuning Linux for SQLite¶
Increase max open files (just in case)¶
ulimit -n 65535
4. Launch the Engine¶
echo "Launching Ticket Masala Pilot on Port 5000..."
Kestrel Configuration for High Performance¶
export Kestrel__Endpoints__Http__Url="http://localhost:5000" export ConnectionStrings__MasalaDb="Data Source=$DB_PATH;Cache=Shared"
$APP_PATH
- The Access: Cloudflare Tunnel (Zero Trust)
Do not port-forward your router. Exposing your home IP (123.45.67.89) to a client is unprofessional and dangerous. They might port scan you.
Use Cloudflare Tunnel (cloudflared). It creates a secure outbound connection from your Linux box to Cloudflare's Edge. The client sees a valid HTTPS certificate and a fast CDN.
Install:
Bash
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb sudo dpkg -i cloudflared.deb
Run (The Magic Command): Bash
cloudflared tunnel --url http://localhost:5000
The Output: It will give you a URL like: https://masala-pilot-demo.trycloudflare.com. Send this URL to the client. It works instantly, supports WebSockets (for your Channels), and hides your IP.
- The Hardware: The "Ryzen AI" Reality Shutterstock
You are on Linux. The NPU drivers (XDNA) for Ryzen AI are currently experimental on Linux (requiring specific kernel patches or the ROCm stack).
The Risk: If you try to force the NPU (Vitis AI Execution Provider) during a live demo, you risk a segmentation fault or a driver crash.
The Architect's Order: Run on CPU for the Demo.
Your Ryzen 395+ CPU is faster than most servers.
It handles AVX-512 instructions (if Zen 5).
It will crush the workload without the NPU.
Only attempt the NPU offload if you have verified dmesg | grep amdxdna shows a healthy driver and you have run the OnnxRuntime test suite successfully. Do not debug kernel drivers while the client is watching. Summary Checklist for Demo Day
Build: dotnet publish -c Release -r linux-x64 ...
Network: cloudflared tunnel --url http://localhost:5000
Database: Pre-loaded 2.7M rows on NVMe.
Monitoring: Run htop in a separate terminal. Show the client how little RAM you are using (Masala Lite doctrine).
Would you like me to generate the masala_gerda.yaml configuration file for the pilot, so you can demonstrate "Live Logic Changes" by editing the file and hitting 'Reload' without restarting the app?