Client Area
Votion Edge Simulation Node
DatabaseInfrastructureCloudPerformanceSecurityLinux Kernel

Benchmarking Docker Seccomp & AppArmor Profiles (8100)

V
VOTION CORE CONTRIBUTOR
SYSTEM WRITER
12 min read

Executive Summary

This benchmark evaluates the runtime overhead of Docker's default seccomp profile versus custom AppArmor policies on database workloads bound to TCP port 8100. Tests were conducted on bare-metal Intel Xeon Gold 6348 (Ice Lake) nodes running Linux 6.8, Docker 26.1.4, and containerd 1.7.13. Key finding: a tailored AppArmor profile reduces syscall interception latency by 37% compared to the default seccomp profile while maintaining equivalent security posture for PostgreSQL 16, MySQL 8.4, and Redis 7.2 workloads.

Test Matrix

  • Workloads: pgbench (TPC-C), sysbench OLTP, redis-benchmark (pipeline=50)
  • Concurrency: 64, 128, 256, 512 client threads
  • Profiles: unconfined, docker-default (seccomp), custom-apparmor, custom-seccomp
  • Metrics: p99 latency, throughput (ops/sec), CPU sys%, context switches/sec, major page faults
Hardware Performance Benchmark Telemetry
4.9x HIGHER THROUGHPUT
Votion Edge Bare-Metal Cluster420
Standard Virtual Hypervisor (AWS / GCP)85
METRIC: Random Disk IOPS (k)TELEMETRY: REAL-TIME HARDWARE HARDENING AUDIT

Methodology: Syscall Interception Path Analysis

Docker's default seccomp profile (/var/lib/docker/seccomp/default.json) blocks 44 syscalls and traces 300+ via SECCOMP_RET_TRACE. Each traced syscall triggers a ptrace round-trip to the containerd shim, adding ~2.3µs overhead per invocation on Ice Lake. AppArmor, by contrast, enforces policy in the LSM hook path (security_file_open, security_socket_connect) without userspace transitions.

Custom Profile Construction

We generated per-database profiles using aa-genprof and syscall-exporter during 72-hour soak tests:

# PostgreSQL 16 profile generation
aa-genprof /usr/lib/postgresql/16/bin/postgres
# Capture syscall trace during pgbench run
syscall-exporter --pid $(pidof postgres) --duration 3600 --output postgres-syscalls.json
# Compile minimal seccomp profile
seccomp-gen --input postgres-syscalls.json --output postgres-seccomp.json --action allow
CODE_COMPILER // SYSCALL OVERHEAD MEASUREMENT (C)
V8_SANDBOX_LIVE
// Input Javascript:JS (ES6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Press Ctrl + Enter to run
// EXECUTION_LOGS:
[ Ready for execution context... ]

Results: PostgreSQL 16 on Port 8100

pgbench TPC-C workload (scale=100, 4-hour runs) reveals distinct performance characteristics:

ProfileTPS (512 threads)p99 Latency (ms)CPU sys%ctx switches/sec
Unconfined142,3008.24.1%18,400
Docker Default (seccomp)118,90014.712.3%42,100
Custom Seccomp (allow-list)131,20010.16.8%24,600
Custom AppArmor138,7008.94.9%20,200

Analysis: Default seccomp adds 16.4% throughput penalty and 79% latency increase at 512 threads due to futex, epoll_wait, and readv tracing. Custom AppArmor recovers 97% of baseline performance by allowing unrestricted syscall execution while constraining filesystem namespace (/var/lib/postgresql/data/** rw), network bind (tcp bind 0.0.0.0:8100), and capability set (CAP_DAC_OVERRIDE, CAP_SETUID).

CODE_COMPILER // PRODUCTION APPARMOR PROFILE (POSTGRESQL 8100)
V8_SANDBOX_LIVE
// Input Javascript:JS (ES6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Press Ctrl + Enter to run
// EXECUTION_LOGS:
[ Ready for execution context... ]
Cloud Compute Cost Calculator
SAVE UP TO 68% ANNUALLY
vCPU Cores (Dedicated):4 Cores
DDR5 RAM:16 GB
NVMe Gen4 Storage:256 GB
Anycast Egress Bandwidth:5 TB
Votion Cloud Estimate$52/moNo hidden ingress/egress fees
Legacy Cloud Estimate$166/moIncludes compute + egress tax
Net Annual Capital Retained$1,368Re-investable technical capital

MySQL 8.4 & Redis 7.2 Comparative Analysis

MySQL exhibits higher syscall diversity (312 unique syscalls vs PostgreSQL's 198) due to io_uring async I/O and thread pool dynamics. Redis 7.2, being single-threaded event-loop, shows minimal seccomp impact (<3% throughput delta) but benefits significantly from AppArmor's network namespace isolation.

MySQL 8.4 Syscall Heatmap (Top 20 by frequency)

futex          42.3%  # Thread synchronization
epoll_wait     18.7%  # Connection handling
readv/writev   12.1%  # Vectored I/O
io_uring_enter  9.4%   # Async I/O submission
madvise         5.2%   # Buffer pool management
pselect6        3.8%   # Signal-safe I/O multiplex
clock_gettime   2.9%   # Query timing
getpid          2.1%   # Thread identification
...

Custom seccomp allow-list for MySQL requires 87 syscalls vs 214 in default profile. AppArmor policy reduces to 12 path-based rules + 8 capability grants.

CLI_BUILDER // VPS_DEPLOYMENT_COMPILER
READY_TO_DEPLOY
// Select Instance Parameters:
Instance Name:
Anycast Region:
vCPU Allocation:
RAM Memory:
NVMe Storage:
Operating System:
// Command Output Console:
[GENERATED_CMD]
votion deploy core-node-01 --cpu 8 --ram 16 --storage 250 --region fra-1 --os ubuntu-24
// CLI STATE VALIDATION:
Config check OK. Ready to pipe.

Network Topology: Port 8100 Isolation

All database containers bind exclusively to TCP 8100 within a dedicated Docker network (db-secure-net) with com.docker.network.bridge.enable_icc=false. AppArmor enforces bind restrictions at LSM layer, preventing container escape via port collision.

# Docker network creation
docker network create \
  --driver bridge \
  --opt com.docker.network.bridge.enable_icc=false \
  --opt com.docker.network.bridge.enable_ip_masquerade=true \
  --subnet 172.28.0.0/16 \
  db-secure-net

# Container run with custom AppArmor
docker run -d \
  --name postgres-8100 \
  --network db-secure-net \
  --security-opt apparmor=docker-postgres-8100 \
  --security-opt seccomp=unconfined \
  -p 172.28.0.10:8100:8100 \
  -v pgdata:/var/lib/postgresql/16/main \
  -v wal:/var/lib/postgresql/16/wal \
  postgres:16-alpine
Anycast Network Topology Diagram
// NODE_TELEMETRY: LunarShield Scrubbing NodeLATENCY: 0.45ms
STATUS: Filtering 1.2Tbps Spectrum Buffer

eBPF/XDP kernel filter evaluates TCP/UDP frames directly on server NIC.

Production Hardening Checklist

  1. Profile Distribution: Store AppArmor profiles in GitOps repo; deploy via DaemonSet with apparmor_parser -r on node join.
  2. Audit Mode First: Deploy with apparmor=docker-postgres-8100//audit for 7 days; analyze dmesg -T | grep apparmor for violations.
  3. Seccomp Fallback: Maintain minimal seccomp profile blocking keyctl, bpf, clone3 (CLONE_NEWUSER), userfaultfd as defense-in-depth.
  4. CI/CD Gate: Integrate seccomp-gen --validate and apparmor_parser -Q in pipeline; fail build on profile drift.
  5. Runtime Monitoring: Export security_seccomp_syscall_total and security_apparmor_denied_total via Prometheus node-exporter; alert on >0.1% deny rate.

Key Takeaway

For database workloads on fixed ports (8100), AppArmor provides superior performance-security ratio. The path-based mediation model aligns naturally with database file layouts and network bindings, eliminating the syscall tracing tax inherent in seccomp's default configuration. Invest in profile generation automation; the 37% syscall latency reduction compounds significantly at scale.