SAP HANA Core Architecture: Services, Daemons & Process Hierarchy

An exhaustive architectural breakdown of SAP HANA internal processes: hdbdaemon, hdbnameserver, hdbindexserver, hdbcompileserver, hdbpreprocessor, hdbwebdispatcher, and their interaction with sapstartsrv and SAP Host Agent.

IntermediateArchitecture~18 min studyHANA 2.0 SPS 00 - SPS 07+

Core Learning Objectives

  • 1.Master the role, binary names, and memory footprints of every HANA operating service.
  • 2.Understand the parent-child relationship anchored by sapstartsrv and hdbdaemon.
  • 3.Explain the Compile Server evolution from HANA 1.0 to HANA 2.0 (integrated vs separate).
  • 4.Diagnose service crash patterns and automatic service restart loops.
Prerequisites:hana-fundamentals-overview

Definition & Architectural Rationale

Technical Definition:

SAP HANA is a multi-process architecture orchestrated by the SAP Start Service (sapstartsrv) and the HANA Watchdog Daemon (hdbdaemon), which supervise individual dedicated engine processes executing specific data storage, compilation, and coordination tasks.

Why this component exists:

Modularizing database functions into distinct Unix daemon processes ensures fault isolation, specialized memory allocation pools, and independent scaling. For example, query compilation spikes in compileserver do not corrupt the transactional memory heaps of the indexserver.

Internal Working & Mechanics

1. Process Hierarchy: - sapstartsrv: Started by the OS or systemd. Reads /usr/sap/<SID>/SYS/profile/<SID>_HDB<Instance>_<Host>. Listens on HTTP (5<NR>13) and HTTPS (5<NR>14) for administrative commands via sapcontrol. - hdbdaemon: Child process of sapstartsrv. The watchdog process. Monitors all HANA engine processes. If an engine crashes (e.g. indexserver OOM), hdbdaemon detects SIGCHLD and automatically re-spawns it. - hdbnameserver: Manages system landscape topology, tenant database definitions, license management, active service endpoints, and persistence mount directories. In HANA 2.0 MDC, the primary Name Server resides in SystemDB. - hdbindexserver: The heart and analytical engine of SAP HANA. Holds the in-memory Column Store and Row Store data, SQL Parser, Query Optimizer, Execution Engine, Persistence Layer, and Transaction Manager. In MDC, EACH tenant database has its own isolated hdbindexserver process! - hdbcompileserver: Performs just-in-time (JIT) compilation of SQLScript procedures, Calculation Views, and execution plans into native C++ machine code. In HANA 2.0 SPS01+, compileserver is run primarily in SystemDB or embedded to optimize footprint. - hdbpreprocessor: Performs unstructured text search indexing, linguistic tokenization, and document extraction. - hdbwebdispatcher: Built-in reverse proxy routing HTTP/HTTPS traffic to XS Advanced (XSA) or web endpoints. - SAP Host Agent (saphostexec): Independent daemon running as root/sapadm at /usr/sap/hostctrl/exe/saphostexec. Listens on port 1128/1129 to provide cross-system hardware telemetry, OS metric collection, and remote lifecycle management.

Architecture Flow Diagram

Mermaid DiagramSAP HANA Core Architecture: Services, Daemons & Process Hierarchy
Architectural Flow: sapstartsrv spawns hdbdaemon, which spawns and watches all database services. SystemDB hosts the Name Server and shared utilities. Each tenant database possesses a dedicated hdbindexserver with its own isolated memory space and SQL port.

Production SQL Diagnostics

Query Active Services, Process IDs, and Memory UtilizationSafe (Read-Only)

Provides live health, CPU percentage, active process IDs, and memory consumed by each service in the instance.

Both
Privileges: MONITORING or CATALOG READ
Target Engine: HANA 2.0 (All SPS)
SELECT HOST, PORT, SERVICE_NAME, PROCESS_ID, SQL_PORT, COORDINATOR_TYPE, ROUND(PROCESS_CPU, 1) AS CPU_PCT, ROUND(PROCESS_PHYSICAL_MEMORY / 1024 / 1024 / 1024, 2) AS RESIDENT_MEM_GB, ROUND(PROCESS_ALLOCATION_LIMIT / 1024 / 1024 / 1024, 2) AS ALLOC_LIMIT_GB FROM SYS.M_SERVICES ORDER BY SERVICE_NAME;

Key Diagnostic Columns

SERVICE_NAME:Process name (nameserver, indexserver, etc.)
PROCESS_ID:Operating system Linux PID
SQL_PORT:Port for client SQL connections (0 if service accepts no SQL)
RESIDENT_MEM_GB:Physical RAM held by this process
ALLOC_LIMIT_GB:Hard limit the service can consume

Expected Diagnostic Output

HOST   | PORT  | SERVICE_NAME    | PROCESS_ID | SQL_PORT | COORDINATOR_TYPE | CPU_PCT | RESIDENT_MEM_GB | ALLOC_LIMIT_GB
-------------------------------------------------------------------------------------------------------------------------
hana01 | 30001 | nameserver      | 4812       | 30013    | MASTER           | 1.2     | 4.10            | 58.00
hana01 | 30003 | indexserver     | 4890       | 30015    | MASTER           | 14.5    | 184.20          | 220.00
hana01 | 30002 | preprocessor    | 4830       | 0        | NONE             | 0.0     | 1.15            | 20.00
hana01 | 30010 | compileserver   | 4855       | 0        | NONE             | 0.1     | 2.30            | 30.00
DBA Interpretation: Indexserver is consuming 184.2 GB of RAM (largest footprint), running normal under its 220 GB allocation limit. CPU is healthy at 14.5%.
Next Diagnostic Action: If a service shows 0 or missing, inspect trace files in /usr/sap/<SID>/HDB<NR>/<host>/trace.

Linux Terminal Diagnostics & Operations

Display Detailed Running HANA Process Tree (HDB info)
user: <sid>adm
Dumps all running HANA instance processes with command lines, PIDs, user identity, and parent PID. Crucial for verifying instance health before SQL access is available.
hdbadm@host $ HDB info

Terminal Standard Output (stdout):

USER       PID  PPID %CPU %MEM    VSZ   RSS TTY STAT START   TIME COMMAND
hdbadm    4510     1  0.0  0.0 120500  4210 ?   S    06:00   0:01 sapstartsrv pf=/usr/sap/HDB/SYS/profile/HDB_HDB00_hana01
hdbadm    4800  4510  0.0  0.1 245000  8910 ?   S    06:01   0:02 hdbdaemon
hdbadm    4812  4800  0.5  1.2 8920100 410200 ? Sl  06:01   1:45  _ hdbnameserver
hdbadm    4830  4800  0.0  0.3 3410200 115000 ? Sl  06:01   0:12  _ hdbpreprocessor
hdbadm    4855  4800  0.1  0.5 4120300 230100 ? Sl  06:01   0:30  _ hdbcompileserver
hdbadm    4890  4800  4.2 46.1 298010000 184200000 ? Sl 06:01 42:10 _ hdbindexserver -port 30003
Output Analysis: PPID 4510 (sapstartsrv) spawned 4800 (hdbdaemon), which in turn spawned child processes: nameserver, preprocessor, compileserver, and indexserver. All processes are in Sl (Interruptible Sleep / Multi-threaded) state.
Check Process Status via sapcontrol API
user: <sid>adm
Queries the sapstartsrv SOAP interface to retrieve high-level colored process states (GREEN, YELLOW, RED).
hdbadm@host $ sapcontrol -nr 00 -function GetProcessList

Terminal Standard Output (stdout):

23.10.2026 08:15:20
GetProcessList
OK
name, description, dispstatus, textstatus, starttime, elapsedtime, pid
hdbdaemon, HDB Daemon, GREEN, Running, 2026 10 23 06:01:10, 2:14:10, 4800
hdbcompileserver, HDB Compileserver, GREEN, Running, 2026 10 23 06:01:12, 2:14:08, 4855
hdbnameserver, HDB Nameserver, GREEN, Running, 2026 10 23 06:01:10, 2:14:10, 4812
hdbpreprocessor, HDB Preprocessor, GREEN, Running, 2026 10 23 06:01:11, 2:14:09, 4830
hdbindexserver, HDB Indexserver - HDB, GREEN, Running, 2026 10 23 06:01:15, 2:14:05, 4890
Output Analysis: All services display GREEN and "Running". If any service is YELLOW, it is still initializing; RED indicates a crash or shutdown.

Troubleshooting & Root Cause Analysis

Production Best Practices & Operational Risks

Mandatory Best Practices

  • Use HDB stop or sapcontrol -nr <NR> -function StopSystem HDB to execute orderly shutdowns that flush redo logs and complete active savepoints.
  • Configure [memorymanager] statement_memory_limit in tenant indexserver.ini to prevent rogue queries from taking down the entire indexserver process.

Risks & Common Gotchas

  • Killing hdbdaemon (kill -9) will kill all child services immediately without graceful savepoint creation!
  • Never kill indexserver with kill -9 in production unless system is completely unrecoverable, as it forces crash recovery during next startup.

Senior DBA Interview Mastery

3–5 Year Experience Target

Official Documentation & SAP Notes

DBA Study Notes & Lab Observations