Steve Sturges
Agenda
Techniques
• Perfmon Preprocessor
• Preprocessor Profiling
• Rule Profiling
White paper
Q&A
2
Goals of Performance Tuning
3
Perfmon Preprocessor
Configuring Perfmon
• Printing to Console vs File
• File provides quicker output, but need to post-process CSV
file
4
Perfmon Preprocessor (cont)
Stats Categories
• Throughput
• CPU Usage
• Pattern Matching
• Stream
• Frag
Looking at Flow Data
• Breakdown of port and packet size distributions
• Look for High Port to High Port traffic
• Look for Heavy talkers/listeners
5
Perfmon Preprocessor (cont)
Throughput Stats
• Higher = better performance
• Increase by steps throughout
CPU Usage
• Lower = better performance
• Decrease by steps throughout
6
Perfmon Preprocessor (cont)
7
Perfmon Preprocessor (cont)
Stream Stats
• Cache Faults, Timeouts
• Increase number of sessions tracked
• Increase memcap
• Correctly set timeout
• TCP SYNs vs SYN/ACKs
• Snort performs best when seeing symmetric traffic
Frag Stats
• Frag Faults, Frag Auto Deletes, Frag Timeouts
• Increase max_frags and memcap
• Use prealloc_memcap or prealloc_frags
• Correctly set timeout
8
Perfmon Preprocessor (cont)
Flow Data
• Breakdown of port and packet size distributions
• Reduce number of packets included in TCP Reassembly
9
Preprocessor Profiling
10
Preprocessor Profiling (cont)
Checks
• Reduce to improve performance
• Correctly configure preprocessor ports
• Ignore traffic as noted earlier
Average per Check
• Reduce to improve performance
• Eliminate large blocks of data, correct configuration of TCP
reassembly ports/services
• Eliminate unnecessary preprocessors based on rule set
• Eliminate unnecessary rules to help MPSE
• Use faster pattern matching algorithm
11
Rule Profiling
12
Rule Profiling (cont)
Microseconds
• Reduce to improve individual rule performance
• Rule time vs Total Snort time
• Investigate if ratio is > 5% total
Checks vs Matches vs Alerts
• Can rules that are not matching be turned off?
• flowbits:noalert can result in match but no alert
• Reduce checks by improving uniqueness and
accuracy of content option used for pattern matching
• Should have at least one content in rule
• Longest pattern used
• Can specify alternate pattern with fastpattern modifier to
content
13
Rule Profiling (cont)
14
Tuning Guidelines Document
Posted on Snort.org
• http://www.snort.org/docs/development-papers/
15
Questions?
16