Complete reference for all 80 runtime parameters — system mode profiles, cache tuning, DB pool settings, UDP server, HTTP server, WebSocket prewarm, webhook push delivery, usage log batching, rate limiting, and price source configuration.
Application parameters control the runtime behavior of The Trinity Beast system. All parameters are stored in the application_parameters table in Aurora (the authoritative source) and cached in ElastiCache as the app:config hash for fast reads.
application_parameter_interval_minutes (default: every 5 minutes).--force-new-deployment) to take effect. See the table below.⚠️ Restart Required vs Hot-Reloadable
| 🔄 Hot-Reloadable (no restart) | 🔁 Restart Required |
|---|---|
cache_ttl_seconds, config_poll_interval_secondsqps, burst, log_levelsqs_batch_size, sqs_flush_ms, sqs_buffer_size, sqs_timeout_msdb_max_open_conns, db_max_idle_conns, db_conn_max_lifetime_minutes, db_conn_max_idle_time_minutesadmin_api_key, demo_api_keyprewarm_assets_list, prewarm_interval_minutes, prewarm_delay_mscoinbase_prewarm_assets, gemini_prewarm_assets, kraken_prewarm_assetsgateio_prewarm_assets, cryptocom_prewarm_assets, okx_prewarm_assetsprice_source_* (all price source params)usage_log_* (all batch/flush params)adaptive_* (all governor params)payment_grace_period_days, usage_warning_green_pct, usage_warning_yellow_pct, usage_warning_red_pctcache_max_retries
|
http_read_timeout_secondshttp_write_timeout_secondshttp_idle_timeout_secondshttp_read_header_timeout_secondshttp_max_header_bytesudp_read_buffer_bytesudp_write_buffer_bytesudp_reader_goroutinesudp_max_concurrent_lpoudp_max_concurrent_lrsudp_workers_per_socketudp_batch_sizeudp_pre_serialize_responsescache_pool_sizecache_min_idle_connscache_dial_timeout_mscache_read_timeout_mscache_write_timeout_ms
|
Why? Hot-reloadable parameters update the Config struct in memory and are read on every request. Restart-required parameters are consumed once when the HTTP server, UDP listeners, or ElastiCache client are created at startup — Go does not allow reconfiguring these after creation.
-- Aurora: authoritative source
SELECT key, value FROM application_parameters;
-- ElastiCache: fast cache (app:config hash)
HGETALL app:config
-- Update a parameter (takes effect within one poll cycle)
INSERT INTO application_parameters (key, value)
VALUES ('cache_ttl_seconds', '30')
ON CONFLICT (key) DO UPDATE SET value = '30';
The /admin/system-mode?mode=<profile_name> endpoint applies a predefined profile from the application_parameter_profiles table in Aurora. Profiles can be added or modified via SQL without code deploys. There are currently 10 profiles covering production, demo, debug, and stress testing across all protocol/topology combinations.
Note: System mode also updates the demo API key's rate_limit_qps and burst_limit in the api_keys table and invalidates the demo key cache. QPS and Burst values shown below are applied to the demo API key.
Key tuning rules applied across all profiles:
db_max_idle always equals db_max_open — prevents connection churn under load (p99 fix: 1,266ms → 8.9ms)cache_min_idle ≈ 33% of cache_pool_size — optimal pre-warm ratiocache_pool_size is always a multiple of 3 — one pool per containerdb_max_open=180 — headroom for LRS report queries alongside LPO writes| Parameter | demo | debug | fresh-price |
|---|---|---|---|
| Purpose | Live demos | Troubleshooting | Production |
qps | 3 | 3 | 1,000 |
burst | 3 | 3 | 1,000 |
log_level | info | debug | error |
cache_ttl | 30 | 60 | 13 |
config_poll | 90 | 30 | 300 |
sqs_batch_size | 10 | 10 | 10 |
sqs_flush_ms | 500 | 500 | 100 |
sqs_buffer_size | 10,000 | 10,000 | 50,000 |
sqs_timeout_ms | 5,000 | 5,000 | 3,000 |
db_max_open | 30 | 30 | 150 |
db_max_idle | 30 | 30 | 150 |
db_conn_lifetime_min | 10 | 10 | 10 |
db_conn_idle_min | 5 | 5 | 5 |
cache_pool_size | 150 | 150 | 600 |
cache_min_idle | 51 | 51 | 201 |
cache_max_retries | 3 | 3 | 1 |
cache_dial_ms | 3,000 | 3,000 | 500 |
cache_read_ms | 3,000 | 3,000 | 500 |
cache_write_ms | 3,000 | 3,000 | 500 |
| Parameter | stress | tcp-direct | tcp-alb | udp-direct | udp-nlb |
|---|---|---|---|---|---|
| Topology | Baseline | 1 node | 3 nodes | 1 node | 3 nodes |
qps | 100K | 100K | 100K | 100K | 100K |
burst | 100K | 100K | 100K | 100K | 100K |
log_level | error | error | error | error | error |
cache_ttl | 300 | 300 | 300 | 300 | 300 |
sqs_batch_size | 10 | 10 | 10 | 10 | 10 |
sqs_flush_ms | 50 | 50 | 50 | 50 | 50 |
sqs_buffer_size | 100,000 | 100,000 | 100,000 | 100,000 | 100,000 |
sqs_timeout_ms | 3,000 | 3,000 | 3,000 | 3,000 | 3,000 |
db_max_open | 150 | 150 | 150 | 150 | 150 |
db_max_idle | 150 | 150 | 150 | 150 | 150 |
db_conn_idle_min | 10 | 10 | 10 | 10 | 10 |
cache_pool_size | 2,997 | 2,997 | 1,998 | 2,997 | 1,998 |
cache_min_idle | 999 | 999 | 666 | 999 | 666 |
| Parameter | combined-direct | combined-alb |
|---|---|---|
| Topology | 1 node, LPO + LRS | 3 nodes, LPO + LRS |
qps | 100K | 100K |
burst | 100K | 100K |
log_level | error | error |
cache_ttl | 300 | 300 |
sqs_batch_size | 10 | 10 |
sqs_flush_ms | 50 | 50 |
sqs_buffer_size | 100,000 | 100,000 |
sqs_timeout_ms | 3,000 | 3,000 |
db_max_open | 180 | 180 |
db_max_idle | 180 | 180 |
db_conn_idle_min | 10 | 10 |
cache_pool_size | 2,997 | 1,998 |
cache_min_idle | 999 | 666 |
Values highlighted in color differ from the baseline stress profile. UDP profiles use smaller batches and longer flush intervals to free CPU for packet processing.
| Parameter | lrs-direct | lrs-alb |
|---|---|---|
| Topology | 1 node, LRS only | 3 nodes, LRS only |
qps | 100K | 100K |
burst | 100K | 100K |
log_level | error | error |
cache_ttl | 300 | 300 |
sqs_batch_size | 10 | 10 |
sqs_flush_ms | 50 | 50 |
sqs_buffer_size | 100,000 | 100,000 |
sqs_timeout_ms | 3,000 | 3,000 |
db_max_open | 180 | 180 |
db_max_idle | 180 | 180 |
db_conn_idle_min | 10 | 10 |
cache_pool_size | 2,997 | 1,998 |
cache_min_idle | 999 | 666 |
cache_read_ms | 1,000 | 1,000 |
LRS profiles use db_max_open=180 for read-heavy report queries and cache_read_ms=1,000 because reports fetch more data per ElastiCache call than single price lookups. Write volume is low (report_usage_logs only), so flush intervals are relaxed.
| Parameter | combined-direct | combined-alb |
|---|---|---|
| Topology | 1 node, LPO + LRS | 3 nodes, LPO + LRS |
qps | 100K | 100K |
burst | 100K | 100K |
log_level | error | error |
cache_ttl | 300 | 300 |
sqs_batch_size | 10 | 10 |
sqs_flush_ms | 50 | 50 |
sqs_buffer_size | 100,000 | 100,000 |
sqs_timeout_ms | 3,000 | 3,000 |
db_max_open | 180 | 180 |
db_max_idle | 180 | 180 |
db_conn_idle_min | 10 | 10 |
cache_pool_size | 2,997 | 1,998 |
cache_min_idle | 999 | 666 |
Combined profiles use db_max_open=180 to give LRS report queries headroom alongside LPO batch writes. This is the production configuration (APP_REPORT_SERVER).
| Parameter | r17-lb-all | r17-tcp-direct | r17-udp-direct | r17-all-direct |
|---|---|---|---|---|
| Phase | 1: Load Balancers | 2: TCP Direct | 3: UDP Direct | 4: All Direct |
| Protocols | All 4 via ALB+NLB | TCP-LPO only | UDP-LPO only | All 4 direct |
db_max_open | 150 | 150 | 150 | 180 |
sqs_batch_size | 10 | 10 | 10 | 10 |
sqs_flush_ms | 50 | 50 | 50 | 50 |
sqs_buffer_size | 100,000 | 100,000 | 100,000 | 100,000 |
sqs_timeout_ms | 3,000 | 3,000 | 3,000 | 3,000 |
cache_pool_size | 1,998 | 2,997 | 2,997 | 2,997 |
cache_read_ms | 1,000 | 500 | 500 | 1,000 |
udp_reader_goroutines | 8 | 8 | 8 | 8 |
udp_read_buffer_mb | 32 | 32 | 32 | 32 |
udp_workers_per_socket | 128 | 128 | 128 | 128 |
udp_batch_size | 32 | 32 | 32 | 32 |
udp_pre_serialize | true | true | true | true |
Run 17 profiles include v8 UDP tuning columns. All phases use SO_REUSEPORT (8 sockets), recvmmsg batch reads (32 datagrams/syscall), 32 MB socket buffers, and pre-serialized response cache. Phase 3 (UDP direct) uses minimal batch/flush settings to maximize CPU for packet processing — this is the 200K+ UDP chase.
All 80 application parameters stored in the application_parameters table in Aurora. Grouped by function. Values shown are the current production settings.
| Parameter Key | Type | Value | Description |
|---|---|---|---|
admin_api_key | string | (secret) | Admin API key for X-Admin-Key header authentication. Required for all /admin/* endpoints. |
application_parameter_interval_minutes | int | 5 | How often (minutes) to reload all parameters from Aurora → ElastiCache → runtime |
config_poll_interval_seconds | int | 300 | How often (seconds) to check for configuration changes in ElastiCache |
demo_api_key | string | demo-public-2026-03-01-abc123 | Demo API key restricted to cpmp-site.org domain only. Used by the live demo on the subscription page. |
log_level | string | error | Log verbosity: error, warn, info, debug. Production runs at 'error' to minimize noise. |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
db_conn_max_idle_time_minutes | int | 10 | Maximum time a database connection can sit idle before being closed |
db_conn_max_lifetime_minutes | int | 10 | Maximum lifetime of a database connection before recycling |
db_max_idle_conns | int | 150 | Maximum idle connections in the Aurora PostgreSQL connection pool |
db_max_open_conns | int | 150 | Maximum open connections to Aurora PostgreSQL |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
cache_dial_timeout_ms | int | 500 | ElastiCache connection dial timeout in milliseconds |
cache_max_retries | int | 1 | Maximum retry attempts for failed ElastiCache operations |
cache_min_idle_conns | int | 999 | Minimum idle connections maintained in the ElastiCache connection pool |
cache_pool_size | int | 2997 | Maximum connections in the ElastiCache (Valkey) connection pool |
cache_read_timeout_ms | int | 500 | ElastiCache read operation timeout in milliseconds |
cache_write_timeout_ms | int | 500 | ElastiCache write operation timeout in milliseconds |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
http_idle_timeout_seconds | int | 300 | HTTP server idle connection timeout (seconds) |
http_max_header_bytes | int | 1048576 | Maximum size of HTTP request headers (bytes). Default: 1 MB. |
http_read_header_timeout_seconds | int | 5 | Timeout for reading HTTP request headers (seconds) |
http_read_timeout_seconds | int | 5 | Timeout for reading the full HTTP request body (seconds) |
http_write_timeout_seconds | int | 5 | Timeout for writing the HTTP response (seconds) |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
udp_batch_size | int | 32 | Number of UDP packets to read in a single recvmmsg batch call |
udp_max_concurrent_lpo | int | 3000 | Maximum concurrent LPO UDP requests in flight per socket |
udp_max_concurrent_lrs | int | 3000 | Maximum concurrent LRS UDP requests in flight per socket |
udp_pre_serialize_responses | boolean | true | Pre-serialize common responses to byte slices for zero-alloc UDP writes |
udp_read_buffer_bytes | int | 33554432 | UDP socket receive buffer size (bytes). Default: 32 MB. |
udp_reader_goroutines | int | 8 | Number of goroutines reading from each UDP socket |
udp_workers_per_socket | int | 128 | Worker pool size per UDP socket for processing requests |
udp_write_buffer_bytes | int | 33554432 | UDP socket send buffer size (bytes). Default: 32 MB. |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
cache_ttl_seconds | int | 300 | How long a cached price is considered fresh (seconds). Current: 5 minutes. |
cacheRetentionDays | int | 93 | Days to retain usage log data in ElastiCache for LRS reporting. Matches the nightly sync purge window. |
max_cache_size | int | 10000 | Maximum number of assets to keep in the in-memory sync.Map price cache |
prewarm_assets_list | string | (150 assets) | Master comma-separated list of all 150 prewarm assets across all 6 exchanges |
prewarm_delay_ms | int | 200 | Delay between individual asset prewarm requests (milliseconds) to avoid exchange rate limiting |
prewarm_interval_minutes | int | 3 | How often (minutes) to run the prewarm cycle for REST fallback sources |
price_source_fallback_on_error | boolean | true | If true, try the next REST source on error. If false, fail immediately. |
price_source_health_window_sec | int | 300 | Rolling window (seconds) for calculating REST source health (success rate + avg latency) |
price_source_min_success_rate | float | 0.0 | Minimum success rate (0.0–1.0) to consider a REST source healthy |
price_source_order | string | gemini,coinbase,kraken | Preferred order of REST fallback price sources (WebSocket feeds are always preferred) |
price_source_prefer_low_latency | boolean | true | If true, prefer the REST source with the lowest recent average latency |
price_source_timeouts_ms | JSON | {"coinbase":100, "kraken":80, "gemini":120} | Per-source timeout in milliseconds for REST fallback queries |
price_source_weights | JSON | {"coinbase":0.50, "kraken":0.35, "gemini":0.15} | Relative preference weights when multiple REST sources are healthy |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
coinbase_prewarm_assets | string | btc,eth,sol,doge,xrp,... | 25 assets prewarmed on the Coinbase WebSocket feed |
cryptocom_prewarm_assets | string | ton,wld,ape,blur,imx,... | 25 assets prewarmed on the Crypto.com WebSocket feed |
gateio_prewarm_assets | string | bnb,trx,apt,sei,inj,... | 25 assets prewarmed on the Gate.io WebSocket feed |
gemini_prewarm_assets | string | aave,atom,arb,crv,grt,... | 25 assets prewarmed on the Gemini WebSocket feed |
kraken_prewarm_assets | string | nano,sc,lsk,kava,bico,... | 25 assets prewarmed on the Kraken WebSocket feed |
okx_prewarm_assets | string | tia,jup,strk,pyth,w,... | 25 assets prewarmed on the OKX WebSocket feed |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
usage_log_batch_seconds | int | 1 | Maximum seconds to wait before flushing the SQS usage log batch |
usage_log_batch_size | int | 100 | Number of usage log entries to batch before sending to SQS |
usage_log_flush_interval_ms | int | 3000 | Background flush interval for the usage log pipeline (milliseconds) |
usage_log_micro_batch_cap | int | 100 | Maximum entries in a single micro-batch before forcing a flush |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
adaptive_enabled | boolean | false | Enable/disable the Distributed Adaptive Governor (cross-node rate coordination via ElastiCache) |
adaptive_max_concurrent | int | 6000 | Maximum concurrent requests allowed across the cluster before throttling |
adaptive_success_threshold | float | 0.50 | Minimum success rate (0.0–1.0) before the governor starts throttling |
adaptive_throttle_delay_ms | int | 0 | Milliseconds to delay throttled requests (0 = reject immediately) |
adaptive_window_size | int | 5000 | Number of recent requests in the sliding window for success rate calculation |
default_query_limit | int | 1000 | Default monthly query limit for the free tier |
minimum_to_wait | float | 1.0 | Minimum seconds between requests when a key is being rate-limited |
seconds_to_wait | float | 15.0 | Cooldown period (seconds) after a rate-limit violation before the key can query again |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
webhook_delivery_retry_max | int | 3 | Maximum retry attempts for failed HTTPS webhook deliveries |
webhook_delivery_timeout_ms | int | 5000 | Timeout for each HTTPS webhook delivery attempt (milliseconds) |
webhook_https_backoff_base_ms | int | 1000 | Base delay for exponential backoff on HTTPS delivery retries (milliseconds) |
webhook_starter_interval_sec | int | 60 | Push interval for Starter tier ($30/mo) — every 60 seconds |
webhook_starter_max_assets | int | 9 | Maximum monitored assets for Starter tier |
webhook_starter_price | int | 30 | Monthly price (USD) for the Starter webhook tier |
webhook_standard_interval_sec | int | 15 | Push interval for Standard tier ($90/mo) — every 15 seconds |
webhook_standard_max_assets | int | 30 | Maximum monitored assets for Standard tier |
webhook_standard_price | int | 90 | Monthly price (USD) for the Standard webhook tier |
webhook_professional_interval_sec | int | 6 | Push interval for Professional tier ($210/mo) — every 6 seconds |
webhook_professional_max_assets | int | 75 | Maximum monitored assets for Professional tier |
webhook_professional_price | int | 210 | Monthly price (USD) for the Professional webhook tier |
webhook_enterprise_interval_sec | int | 3 | Push interval for Enterprise tier ($540/mo) — every 3 seconds |
webhook_enterprise_max_assets | int | 150 | Maximum monitored assets for Enterprise tier (all 150) |
webhook_enterprise_price | int | 540 | Monthly price (USD) for the Enterprise webhook tier |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
payment_grace_period_days | int | 7 | Days after payment failure before subscription is downgraded to free tier |
stripe_key | string | (secret) | Stripe API secret key for payment processing |
| Parameter Key | Type | Value | Description |
|---|---|---|---|
usage_warning_green_pct | int | 85 | Usage percentage threshold for green (healthy) status indicator |
usage_warning_yellow_pct | int | 90 | Usage percentage threshold for yellow (warning) status indicator |
usage_warning_red_pct | int | 95 | Usage percentage threshold for red (critical) status indicator |
usage_warning_threshold_pct | int | 90 | Usage percentage at which warning notifications are triggered |
Controls log verbosity and diagnostic output. The log_level parameter is the primary control; debug_messages is deprecated but still honored for backward compatibility.
| Parameter | Type | Default | Description |
|---|---|---|---|
log_level |
string | "info" |
Logging level: debug, info, error. Applied immediately via callback — no restart needed. |
debug_messages |
string | "false" |
DEPRECATED. When set to "true", forces log level to debug. Use log_level=debug instead. DEPRECATED |
Controls cache freshness, retention, size limits, and the prewarm cycles that keep the cache warm for popular assets. The main prewarm cycle covers top assets via WebSocket and REST; the Kraken prewarm handles exchange-exclusive assets separately.
| Parameter | Type | Default | Description |
|---|---|---|---|
cache_ttl_seconds |
int | 60 | How long a cached price is considered fresh (seconds). Lower values mean fresher prices but more REST fallback calls. |
cacheRetentionDays |
int | 93 | Days to retain cached data in ElastiCache. Entries older than this are eligible for eviction. |
max_cache_size |
int | 10000 | Maximum entries in the local in-memory price cache (sync.Map). Prevents unbounded memory growth. |
prewarm_assets_list |
string | "btc,eth,sol,...,bat" |
Legacy combined list of assets for the REST prewarm cycle. 24 assets (Coinbase + Gemini lists combined). |
prewarm_interval_minutes |
int | 10 | How often (minutes) to run the REST prewarm cycle for assets in prewarm_assets_list. |
prewarm_delay_ms |
int | 600 | Delay (ms) between individual asset prewarm requests. Prevents thundering herd on external APIs. |
Each exchange has its own dedicated asset list. Assets must not overlap between exchanges. All lists are configurable via application parameters — no hardcoding. Changes take effect on the next parameter reload, but require a container restart for the WebSocket connections to re-subscribe.
| Parameter | Exchange | Default (24 assets) | WebSocket Endpoint |
|---|---|---|---|
coinbase_prewarm_assets |
Coinbase | btc,eth,sol,doge,xrp,link,dot,ltc,avax,uni,pepe,xlm,rndr,jasmy,icp,eos,egld,zec,enj,ankr,lrc,skl,coti,rlc |
wss://advanced-trade-ws.coinbase.com |
gemini_prewarm_assets |
Gemini | aave,ada,matic,atom,near,arb,mkr,crv,grt,fil,shib,bat,mana,sand,axs,chz,storj,amp,ren,uma,bond,ctsi,rly,rad |
wss://ws.gemini.com |
kraken_prewarm_assets |
Kraken | nano,sc,lsk,kava,bico,rari,ocean,cfg,cqt,algo,fet,flow,mina,glmr,movr,ksm,astr,phala,nodl,para,kilt,aca,teer,lit |
wss://ws.kraken.com/v2 |
gateio_prewarm_assets |
Gate.io | bnb,trx,apt,inj,op,sui,vet,hbar,ftm,celr,dent,hot,one,reef,win,tfuel,stmx,troy,vite,oax,pundix,ach,bel,chess |
wss://api.gateio.ws/ws/v4/ |
cryptocom_prewarm_assets |
Crypto.com | ton,wld,ape,blur,imx,ens,ldo,snx,comp,1inch,sushi,gala,magic,rdnt,hook,id,edu,cyber,arkm,ntrn,mav,sei,woo,agld |
wss://stream.crypto.com/exchange/v1/market |
okx_prewarm_assets |
OKX | kas,tia,jup,strk,pyth,w,zro,pendle,ondo,render,wif,floki,people,mask,looks,high,rss3,perp,badger,alcx,fxs,tribe,alpha,dodo |
wss://ws.okx.com:8443/ws/v5/public |
150 assets, 6 exchanges, zero overlap. Each exchange subscribes to 25 unique assets via its own persistent WebSocket connection. Prices are pushed in real-time (sub-second) directly into the in-process sync.Map — zero network calls on the hot path. The source exchange is tracked in every response and usage log via the source field (e.g., coinbase-ws, binance-ws, okx-ws).
Controls the Go database/sql connection pool settings for Aurora Serverless v2. Changes are applied immediately via database.ApplyPoolSettings() after each parameter reload.
| Parameter | Type | Default | Description |
|---|---|---|---|
db_max_open_conns |
int | 50 | Max open connections to Aurora. Higher values support more concurrent queries but consume more ACUs. |
db_max_idle_conns |
int | 30 | Max idle connections kept warm in the pool. Should be less than or equal to db_max_open_conns. |
db_conn_max_lifetime_minutes |
int | 5 | Max lifetime of a DB connection before it is closed and recycled. Prevents stale connections. |
db_conn_max_idle_time_minutes |
int | 1 | Max time a DB connection can sit idle before being closed. Frees resources during low traffic. |
Usage logs are now sent to SQS via a channel-buffered producer, consumed by the trinity-beast-queued-writer Lambda, and batch-inserted into Aurora. No more direct Aurora writes from the hot path.
| Parameter | Type | Default | Description |
|---|---|---|---|
sqs_batch_size |
int | 10 | Messages per SQS SendMessageBatch call (range: 1–10) |
sqs_flush_ms |
int | 100 | SQS producer flush interval in milliseconds |
sqs_buffer_size |
int | 50000 | SQS producer channel buffer capacity |
sqs_timeout_ms |
int | 3000 | Per-batch SQS API call timeout in milliseconds |
Controls the REST fallback price source behavior — priority order, per-source timeouts, weighted routing, health tracking, and error handling. These only apply when all WebSocket feeds are stale and the system falls back to REST.
| Parameter | Type | Default | Description |
|---|---|---|---|
price_source_order |
string | "coinbase,kraken,gemini" |
REST fallback source priority order. Sources are tried in this order when fallback is needed. |
price_source_weights |
string | {'coinbase':0.50,'kraken':0.35,'gemini':0.15} |
Source selection weights for weighted routing. Weights should sum to 1.0. |
price_source_timeouts_ms |
string | {'coinbase':150,'kraken':120,'gemini':200} |
Per-source REST timeout in milliseconds. Requests exceeding this timeout are cancelled. |
price_source_fallback_on_error |
bool | true | Whether to try the next source in price_source_order when the current source returns an error. |
price_source_health_window_sec |
int | 300 | Time window (seconds) over which source health metrics are tracked. Older data is discarded. |
price_source_min_success_rate |
float | 0.85 | Minimum success rate (0.0–1.0) to consider a source healthy. Sources below this threshold may be deprioritized. |
price_source_prefer_low_latency |
bool | true | Whether to prefer lower-latency sources when multiple healthy sources are available. |
Controls rate limiting behavior, the demo API key, and default query pagination.
| Parameter | Type | Default | Description |
|---|---|---|---|
demo_api_key |
string | "" | The public demo API key value. When set, the system resolves the key's UUID from ElastiCache or Aurora for fast lookups. |
demo_usage_row_cap |
int | 30 | Max rows returned for demo usage detail and report-usage detail reports. Adjustable at runtime for specific demos. |
demo_summary_row_cap |
int | 300 | Max rows aggregated for demo usage summary and report-usage summary reports. Adjustable at runtime for specific demos. |
usage_warning_threshold_pct |
int | 90 | Deprecated — replaced by graduated thresholds below. Kept for backward compatibility. |
usage_warning_green_pct |
int | 85 | At or above this usage percentage, responses include usage_warning: "green" and status shows ✅🟡. First tier of graduated warnings. |
usage_warning_yellow_pct |
int | 90 | At or above this usage percentage, responses include usage_warning: "yellow" and status shows ✅⚠️. Second tier — caution. |
usage_warning_red_pct |
int | 95 | At or above this usage percentage, responses include usage_warning: "red" and status shows ✅🔴. Third tier — critical, near limit. |
minimum_to_wait |
float | 1.0 | Minimum wait time (seconds) between requests for rate limiting. |
seconds_to_wait |
float | 15.0 | Seconds to wait before retrying a failed source. |
default_query_limit |
int | 1000 | Default pagination limit for queries when no explicit limit is provided. |
Core system parameters that control polling intervals, authentication, and external service integration.
| Parameter | Type | Default | Description |
|---|---|---|---|
application_parameter_interval_minutes |
int | 5 | How often (minutes) to reload all parameters from Aurora. This is the master polling interval for the parameter loader. |
config_poll_interval_seconds |
int | 60 | How often (seconds) to poll for config interval changes. This is a faster inner loop that checks if the main interval has changed. |
admin_api_key |
string | "" | Admin API key for X-Admin-Key header authentication. Applied immediately via callback to update the admin auth middleware. SECRET |
stripe_key |
string | "" | Stripe API key for payment processing. SECRET |
v8 introduced six new parameters controlling the UDP hot path. These parameters are restart-required — they configure socket options and goroutine counts at startup.
v8 UDP Architecture: Each protocol (LPO on port 2679, LRS on port 2680) opens udp_reader_goroutines SO_REUSEPORT sockets. The kernel distributes incoming packets across sockets by source IP hash. Each socket has its own reader goroutine that uses recvmmsg to pull up to udp_batch_size datagrams per syscall, dispatching them to udp_workers_per_socket worker goroutines. For cache hits, udp_pre_serialize_responses skips the response build step entirely — the pre-built JSON payload is written directly to the socket.
| Parameter Key | Type | Default | Description |
|---|---|---|---|
udp_reader_goroutines |
int | 8 | Number of SO_REUSEPORT sockets per UDP protocol. Each socket gets its own kernel receive queue. v7 was 3, v8 bumped to 8 after the manual parser freed CPU headroom. Total workers = readers × workers_per_socket. |
udp_read_buffer_bytes |
int | 33554432 | Per-socket kernel receive buffer (SO_RCVBUF). v8 default: 32 MB (was 8 MB). Absorbs burst spikes before the kernel drops packets. Set via conn.SetReadBuffer(). |
udp_write_buffer_bytes |
int | 33554432 | Per-socket kernel send buffer (SO_SNDBUF). v8 default: 32 MB (was 8 MB). Prevents write backpressure under high response rates. |
udp_workers_per_socket |
int | 128 | Worker goroutines per socket. Each worker processes one packet at a time (parse → validate → cache lookup → response). 128 is optimal for dual-protocol without OOM risk. Tested at 256 — caused OOM under combined TCP+UDP load. |
udp_batch_size |
int | 32 | Max datagrams per recvmmsg batch read. At 75K RPS with batch=32, reduces read syscalls from 75K/s to ~2.3K/s per socket. Set to 0 or 1 to disable batching and use the v7 single-read path. |
udp_pre_serialize_responses |
bool | true | Enable pre-serialized response cache for hot assets. When a price is cached in sync.Map, the JSON response payload is pre-built once. Subsequent cache hits skip all strconv.AppendFloat / AppendInt formatting — just memcpy the pre-built bytes + append per-request fields (api_key, usage, ip). ~2x faster than v7 zero-copy for cache hits. |
Stress Report Cache (v8): For stress-tier API keys, LRS report results are cached in ElastiCache under stress:report:{type}:{api_key} with a 2-hour TTL. This turns the LRS hot path from a multi-key pipeline query (176ms avg) into a single GET (sub-ms). Seeded automatically on first query or via /admin/seed-stress-report?api_key=<key>. Production tiers always run the real query pipeline.