Performance monitor
Theperf_monitor module captures peg counts from Snort modules at runtime and at regular intervals, without requiring a restart. This is useful for feeding data to external dashboards or spotting issues while Snort is running.
Trackers
perf_monitor includes several independent trackers you can enable in any combination.
Base tracker — module counters
Base tracker — module counters
Captures running statistics from all Snort modules. Stats cover the interval since the last report and are reset at the start of each interval — the same counts you see at shutdown, broken down by time window.Enable everything:Enable all counters for a specific module:Enable specific counters within a module:
Event statistics from Snort 2’s
perfmonitor are now located within base statistics.Flow tracker — traffic distributions
Flow tracker — traffic distributions
Tracks statistics about traffic volume and L3/L4 protocol distributions. Use this to build a traffic profile for inspector tuning and to identify where Snort may be under load.
FlowIP tracker — per-host statistics
FlowIP tracker — per-host statistics
Provides statistics for individual hosts: how much data they generate, how many sessions they open, and typical packet sizes. Useful for identifying unusual communication habits.
CPU tracker — thread time usage
CPU tracker — thread time usage
Monitors CPU time and wall time spent by each processing thread.
Output formats
perf_monitor can produce output in human-readable text (the same format as the shutdown summary), CSV, or JSON. JSON output is well-suited for feeding into external tools.
Profiler module
Theprofiler module tracks time and memory usage per module and per rule. Its output appears under Summary Statistics at shutdown.
Enable module and rule profiling in snort.lua:
Reading profiler output
At shutdown, the profiler prints a table sorted by time consumed. Each row shows:- Module or rule name
- Checks — how many times it was invoked
- Time (usec) — total microseconds spent
- Avg (usec) — average per invocation
Pattern matching
Snort’s fast pattern matching engine determines how quickly rules are evaluated against packet data. The engine is selected viasearch_engine.search_method in snort.lua.
| Method | Description |
|---|---|
ac_bnfa | Default. Aho-Corasick with a compact NFA. Balances speed and memory. |
ac_full | Full Aho-Corasick with a full transition table. Faster than ac_bnfa but uses significantly more memory. |
hyperscan | Intel Hyperscan. Best performance. Requires Snort to be built with Hyperscan support. |
ac_full:
Hyperscan is also used by the
regex and sd_pattern rule options. Build Snort with --enable-hyperscan and install Hyperscan >= 4.4.0 to enable it.Multi-threading
Snort 3 can process multiple input sources simultaneously using packet threads. Each thread runs an independent copy of the detection pipeline. Set the maximum number of packet threads with-z or --max-packet-threads:
Thread assignment for pcap files
- Snort starts up to
-zthreads to process files. - As a thread finishes a file, it picks up the next unprocessed one.
- If there are fewer files than threads, fewer threads are started.
Thread assignment for live interfaces
- All threads up to
-zare always started. - With multiple interface inputs, each thread receives one ordinally, falling back to the first if threads outnumber inputs.
Memory optimization
Snort 3 has a more scalable memory profile than Snort 2. Some knobs that affect memory usage: Session timeout (stream_tcp.session_timeout): Shorter timeouts allow Snort to reclaim session state sooner, reducing memory consumption in high-connection-rate environments.
daq.snaplen): Reducing the capture length lowers the per-packet buffer size. The default is 1518 bytes.
Reload without restart
You can reload a modifiedsnort.lua without stopping Snort by sending SIGHUP:
Parameters that require a restart
Some parameters cannot be changed during a reload. If you change any of the following, Snort will reject the reload withreload failed - restart required and continue using the original config.
Parameters requiring restart
Parameters requiring restart
active.attemptsactive.devicealerts.detection_filter_memcapalerts.event_filter_memcapalerts.rate_filter_memcapattribute_table.max_hostsattribute_table.max_services_per_hostdaq.snaplenfile_inspect.max_files_cachedprocess.chrootprocess.daemonprocess.set_gidprocess.set_uidsnort.--bpfsnort.-ltrace.output
Scenarios requiring restart
Scenarios requiring restart
- Enabling file capture for the first time
- Changing
file_inspect.capture_memcapif file capture was previously or currently enabled - Changing
file_inspect.capture_block_sizeif file capture was previously or currently enabled - Adding or removing
stream_*inspectors whenstreamwas already configured
Latency monitoring
Thelatency module enforces time limits on packet and flow processing. When a limit is exceeded, Snort can drop the packet or disable further inspection on the flow.
Enable latency monitoring in snort.lua:
packet.max_time— maximum microseconds allowed to process a single packetflow.max_time— maximum microseconds allowed for flow-level inspectionaction—logto record violations,dropto also drop the offending packet

