| |

AdTech & Real-Time Bidding (RTB) Low-Latency Bare-Metal Infrastructure

AdTech & RTB Low-Latency Bare-Metal Infrastructure technical architecture and dedicated infrastructure diagram
Verified Technical Answer

Real-Time Bidding (RTB) Demand-Side Platforms (DSPs) and Supply-Side Platforms (SSPs) enforce strict OpenRTB auction timeouts of 50 ms to 120 ms end-to-end, leaving only 8 ms to 20 ms for internal bidder inference, budget checks, and serialization. Bare-metal servers eliminate hypervisor CPU steal, vCPU scheduling jitter, and virtio network bridge serialization, keeping p99 auction response times predictable under 100,000+ QPS bursts when paired with NUMA-local memory pinning, Transparent HugePages disabled in favor of explicit 2 MB hugepages, and dedicated RSS NIC interrupt queues.

Programmatic advertising exchanges penalize slow bidders ruthlessly: an OpenRTB bid response arriving even two milliseconds past the SSP deadline is discarded as a timeout, wasting ingress bandwidth, CPU cycles, and impression revenue. While public cloud instances routinely exhibit multi-millisecond tail-latency spikes from noisy neighbors, live migrations, and virtual switch encapsulation, dedicated hardware gives AdTech engineering teams deterministic control over every microsecond from NIC ring buffer to Aerospike or Redis feature store lookup.

Tail-Latency Budget

Keep internal bidder evaluation under 10 ms at p99 so network RTT and exchange parsing stay inside a 100 ms OpenRTB auction window.

Zero Hypervisor Jitter

Direct PCIe access to 25GbE/100GbE NICs and NVMe namespaces removes vSwitch context switches and hypervisor steal time.

NUMA & Memory Determinism

Pin bidder worker threads, NIC IRQ queues, and in-memory user-profile shards to the same CPU socket and local DDR5 channels.

1. Anatomy of an OpenRTB Latency Budget on Bare Metal

An OpenRTB 2.5 or 2.6 auction traverses TLS termination, HTTP/1.1 or HTTP/2 connection pooling, JSON or Protobuf bid-request deserialization, user-segment lookup, frequency-cap verification, pacing control, CTR/CVR model scoring, and bid serialization. Over a WAN hop of 35 ms to 60 ms round-trip between an exchange PoP and your bidder cluster, the application tier often receives an internal budget of 12 ms at p95 and under 20 ms at p99. Any kernel stall—such as page-cache reclaim, THP compaction, or cross-socket memory traversal—immediately pushes bids over the timeout cliff.

Why Average Latency Metrics Hide Exchange Timeout Losses

Monitoring mean bidder response time creates a dangerous blind spot because an exchange evaluates every request individually. A cluster reporting a 4 ms average can still drop 6% of auctions if garbage-collection pauses or softirq saturation push p99 above 45 ms during peak traffic waves. Choosing high-frequency silicon and deterministic core topologies—explored in detail in our Intel Xeon vs. AMD EPYC dedicated server comparison—lets teams align L3 cache size and single-thread boost clocks with either C++/Rust low-level bidders or memory-intensive JVM/Go scoring pipelines.

  • Ingress parsing & TLS: Persistent HTTP/2 or keep-alive HTTP/1.1 pools with TLS session tickets avoid repeated 1-RTT/2-RTT handshakes per exchange connection.
  • Feature store lookup: Co-locating an NVMe-backed Aerospike or KeyDB read replica on the bidder rack keeps user-profile reads below 400 microseconds.
  • Pacing & budget state: Lock-free ring buffers or thread-local token buckets updated asynchronously prevent mutex contention across 64+ worker threads.
  • Async telemetry emission: Win-notice and impression-event logs must flow to local memory-mapped buffers or Kafka producers off the critical bidding thread.

2. NUMA Topology, HugePages & Memory Subsystem Determinism

Dual-socket servers and multi-chiplet EPYC processors introduce Non-Uniform Memory Access (NUMA) domains where accessing RAM attached to a remote socket or distant CCD incurs 40 ns to 90 ns of additional latency per cache miss. At 120,000 QPS, random cross-NUMA pointer chasing across a 32 GB campaign targeting tree saturates UPI or Infinity Fabric interconnects and doubles tail latency. In addition, Linux Transparent HugePages (THP) trigger synchronous khugepaged memory compaction stalls that freeze allocation paths for tens of milliseconds.

Explicit HugePages vs. Transparent HugePages (THP)

Per the official Linux Kernel Memory Management documentation, disabling automatic THP defragmentation and pre-allocating static 2 MB hugepages at boot eliminates runtime compaction stalls and drastically shrinks Translation Lookaside Buffer (TLB) miss rates for large in-memory targeting graphs and Aerospike indexes. Combined with bare-metal root access and kernel customization, engineers can isolate bidder cores with isolcpus, bind each bidder process to a single NUMA node via numactl --cpunodebind=0 --membind=0, and lock hugepages into physical RAM.

# Inspect NUMA node distances and NIC PCIe NUMA affinity
numactl --hardware
cat /sys/class/net/ens1f0np0/device/numa_node

# Disable THP compaction stalls and reserve 16384 x 2MB static hugepages (32 GB)
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
sysctl -w vm.nr_hugepages=16384
sysctl -w vm.swappiness=0

# Launch bidder shard pinned strictly to NUMA node 0
numactl --cpunodebind=0 --membind=0 /opt/dsp/bin/rtb-bidder --threads 32

3. NIC Ring Buffers, RSS Interrupt Affinity & TCP Stack Tuning

Real-time bidding workloads generate unusually high packet-per-second (PPS) rates with small payloads (typically 1.2 KB to 4 KB per OpenRTB bid request). Default Linux distributions ship with conservative NIC RX/TX descriptor ring sizes, generic interrupt coalescing, and small socket backlog queues that silently drop SYN or HTTP payload packets during 2x traffic spikes at top-of-the-hour campaign resets.

Aligning RSS Queues, XDP/SO_REUSEPORT, and Congestion Control

Pinning Receive Side Scaling (RSS) hardware queues to dedicated cores on the exact NUMA node where the NIC physically resides ensures L1/L2 cache warmth when packets transition from softirq into user-space socket workers using SO_REUSEPORT. For bidders returning rich creative payloads or communicating with remote SSP endpoints across lossy WAN paths, enabling pacing-aware transport as detailed in our TCP BBR congestion control optimization guide prevents head-of-line bufferbloat while maximizing connection reuse efficiency.

# /etc/sysctl.d/99-rtb-network.conf - High-PPS OpenRTB tuning
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 250000
net.core.netdev_budget = 600
net.core.busy_read = 50
net.core.busy_poll = 50
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_slow_start_after_idle = 0

# Expand NIC RX/TX ring buffers and disable adaptive coalescing for deterministic latency
ethtool -G ens1f0np0 rx 4096 tx 4096
ethtool -C ens1f0np0 adaptive-rx off rx-usecs 8

Rollback & Safety Precaution: Always validate sysctl and ethtool changes on a single canary bidder node behind your load balancer first, and keep a persistent snapshot of baseline defaults (sysctl -a > /root/baseline-sysctl.txt). Setting busy_poll too high or zeroing rx-usecs on older 10GbE NICs can spike softirq CPU utilization to 100% under micro-bursts; if packet drops appear in ethtool -S, revert ring/coalesce settings immediately.

4. Bare Metal vs. Cloud VMs vs. DPDK Kernel-Bypass Architectures

AdTech architects generally choose among three infrastructure tiers depending on QPS volume, engineering headcount, and auction SLA sensitivity: standard cloud VMs, tuned Linux bare metal, or user-space kernel-bypass stacks (DPDK/AF_XDP) on bare metal.

Architecture Tier Typical Bidder p99 Latency Max Sustained QPS per Node Operational Complexity Best RTB Use Case
Public Cloud VM (Enhanced Networking) 14 ms – 38 ms (noisy tail) 15,000 – 35,000 QPS Low (managed APIs) Burst testing, dev sandboxes, low-QPS retargeting
Tuned Linux Bare Metal (NUMA + RSS + HugePages) 3.5 ms – 8.5 ms 75,000 – 160,000 QPS Moderate (Ansible/sysctl) Production DSP bidders, SSP routers, DMP edge nodes
Bare Metal + AF_XDP / DPDK User-Space Stack 0.8 ms – 2.5 ms 250,000+ QPS High (custom C/Rust dataplane) Ultra-high-QPS ad exchanges, SSP header-bidding proxies

For 90% of programmatic DSPs, tuned Linux bare metal strikes the optimal engineering balance. It preserves standard tooling (tcpdump, eBPF bpftrace, Envoy/HAProxy, Prometheus node exporters) while delivering an order-of-magnitude reduction in p99 variance and eliminating per-GB cloud egress fees that rapidly erode campaign margins.

5. Local NVMe Feature Stores, Async Logging & Edge Resiliency

Even stateless bidder binaries depend on stateful subsystems: user-profile key-value stores (Aerospike, Redis Cluster, ScyllaDB), bloom-filter fraud lists, and high-throughput click/impression event pipelines. Running Aerospike in hybrid-memory mode directly on enterprise PCIe Gen4/Gen5 NVMe drives with direct-files or raw block devices bypasses the OS page cache and sustains sub-millisecond p99 reads at over 500,000 TPS per node.

Isolating Telemetry I/O from the Critical Bidding Path

Never write synchronous JSON auction logs onto the same NVMe namespace or CPU cores serving live bidders. Dedicate a separate NVMe volume or ring-buffered Vector/Fluent Bit agent pinned to housekeeping cores (for example, cores 0-3) so disk fsync flushes, log rotation compression, and Kafka batch retries never preempt auction threads. Pair dual power feeds, LACP bonded 25GbE uplinks, and BGP anycast or GeoDNS health checks so any single bare-metal chassis drains cleanly in under three seconds without breaking active exchange SLAs.

Frequently Asked Questions

How much p99 latency improvement do RTB bidders typically see moving from cloud VMs to bare metal?

Production DSP migrations commonly reduce p99 internal bidder latency by 45% to 70%—often dropping from 18-35 ms on virtualized instances down to 4-8 ms on NUMA-pinned bare metal—while eliminating sudden tail spikes caused by hypervisor scheduling and virtual network bridge contention.

Should Transparent HugePages (THP) be enabled or disabled for AdTech bidding nodes?

Transparent HugePages should be set to ‘never’ on latency-sensitive RTB nodes because synchronous background compaction stalls allocation threads. Instead, reserve explicit static 2 MB hugepages via vm.nr_hugepages for Aerospike, Redis, or C++/JVM heap structures.

What NIC speed and port layout is recommended for a 100,000 QPS RTB bidder?

A pair of redundant 25GbE SFP28 ports (bonded via LACP 802.3ad) connected to separate top-of-rack switches provides ample headroom for 100,000+ QPS of bidirectional OpenRTB JSON traffic plus telemetry replication, while preserving hardware RSS queue scalability.

Does TCP BBR help AdTech workloads over long-lived exchange connections?

Yes. When bidders communicate with remote SSP PoPs over variable WAN paths or deliver larger VAST/creative payloads, TCP BBR prevents queue buildup and packet-loss-induced cwnd collapse far better than CUBIC, keeping HTTP/2 multiplexed streams responsive.

How should user-profile databases like Aerospike be deployed alongside bidders?

For sub-millisecond reads, either co-locate Aerospike on dedicated NUMA nodes and raw NVMe namespaces in the same rack (connected over 25GbE/100GbE private VLANs) or run a dedicated NVMe storage cluster with rack-aware replication factor 2.

Can eBPF or XDP accelerate RTB filtering without rewriting the bidder in DPDK?

Yes. XDP programs attached at the NIC driver layer can drop malformed OpenRTB requests, block known botnets, or enforce rate limits before the Linux kernel even allocates an sk_buff structure, preserving standard socket compatibility for your application.

Deploy Ultra-Low-Latency Bare Metal for Your RTB Stack

Run OpenRTB bidders, Aerospike feature stores, and high-PPS ingress proxies on dedicated AMD EPYC and Intel Xeon servers with NVMe Gen4 storage and full root kernel control.

Explore Linux Dedicated Servers

NR
Naveen Rajput — Infrastructure & Cloud Systems Architect

Reviewed by Onlive Server Infrastructure Engineering for technical accuracy, kernel/network safety, and global bare-metal operations.