Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate default capture settings for best Suricata performance #435

Closed
mmguero opened this issue Mar 4, 2024 · 2 comments
Closed

investigate default capture settings for best Suricata performance #435

mmguero opened this issue Mar 4, 2024 · 2 comments
Assignees
Labels
performance Related to speed/performance suricata Relating to Malcolm's use of Suricata
Milestone

Comments

@mmguero
Copy link
Collaborator

mmguero commented Mar 4, 2024

We're not doing much in the way of tuning for Suricata capture, neither on Malcolm or on Hedgehog. We should go over some of these resources and make adjustments where needed. However, note that we do have a number of variables that can be set via suricata_config_populate.py so we might already have the stuff in place to handle it. We just need to examine what might be best for good defaults to work fast "out of the box."

We should look at the defaults for any of the following:

  • the af-packet section
  • anything else that has to do with memory caps, hash sizes, buffer sizes, etc.
@mmguero mmguero added bug Something isn't working performance Related to speed/performance labels Mar 4, 2024
@mmguero mmguero added this to the v24.03.1 milestone Mar 4, 2024
@mmguero mmguero added this to Malcolm Mar 4, 2024
@mmguero mmguero moved this to Todo (investigate) in Malcolm Mar 4, 2024
@mmguero mmguero changed the title investigate capture settings for best Suricata performance investigate default capture settings for best Suricata performance Mar 4, 2024
@mmguero mmguero added suricata Relating to Malcolm's use of Suricata and removed bug Something isn't working labels Mar 4, 2024
@mmguero mmguero added the falcon label Mar 18, 2024
@mmguero
Copy link
Collaborator Author

mmguero commented Mar 19, 2024

See #445 as well, as splitting out eve.json by thread and enabling rotation will also help with performance.

@mmguero mmguero assigned mmguero and unassigned mmguero Mar 20, 2024
@mmguero
Copy link
Collaborator Author

mmguero commented Mar 21, 2024

(note: all Malcolm environment variables in this document should be prepended with SURICATA_)

Tuning Considerations

Suricata setting Malcolm variable Default
max-pending-packets MAX_PENDING_PACKETS 1024
mpm-algo (not currently adjustable) AC (Aho-Corasick)
detect.profile (not currently adjustable) high
detect.sgh-mpm-context (not currently adjustable) single
af-packet various various
stream.bypass (not currently adjustable) no
  • we may want to see if Hyperscan is available/being used (I'm not sure without looking it up)

High Performance

  • NIC
    • nic-capture-setup.sh is used to set NIC settings if PCAP_IFACE_TWEAK is true in pcap-capture or arkime-live containers. I should probably do this across all capture containers (I don't think it hurts anything to call it more than once, e.g., in each container's startup).
    • the value of threads can be set with the AF_PACKET_IFACE_THREADS variable (default is auto)
    • cluster-type can be set with AF_PACKET_CLUSTER_TYPE (default is cluster_flow)
      • cluster_qm could be used for "high end systems/NICs", see the Suricata documentation linked, although I don't think nic-capture-setup.sh does everything it's talking about there
  • CPU affinity and NUMA
    • I'm not sure how we could do the ethtool stuff in a general sense with scripting minus just giving the user the ability to provide a script, but I feel like with that amount of specificity it might make sense to just run this external to Malcolm, as it seems quite specific to the NIC. We could potentially provide some variables for the cpu-affinity section under threading.
    • here it discusses some default values for ring-size and block-size which are significantly smaller than our defaults, we may want to examine those
  • Other considerations
    • this mentions the isolcpus kernel boot parameter. There's nothign we could do about this for Docker/Kubernetes installations, but for the ISOs maybe it's something we want to look at

IP Defrag

  • Settings are found here. I'm not sure if our default settings are recommended or not, although they match the example in the documentation.

Flow and Stream handling

  • Flow settings are found here.
    • We may want to add options for emergency_recovery and prune_flows.
    • We are not doing anything with Flow Time-Outs
  • Stream setings are found here
    • We may want to add an option for memcap-policy

Defaults

  • We should look at all default values here and confirm that they make sense generally for all (or most) Malcolm users. Otherwise the user can override them.

@mmguero mmguero modified the milestones: v24.03.1, v24.04.0 Mar 21, 2024
@mmguero mmguero modified the milestones: v24.04.0, z.staging Apr 23, 2024
@mmguero mmguero removed the falcon label May 7, 2024
@mmguero mmguero modified the milestones: z.staging, v24.05.0 May 13, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue May 15, 2024
…k and documentation updates

- see idaholab#475 for the zeek deploy changes
- see idaholab#435 for an issue about Suricata settings (documentation changes)
- Arkime documentation changes as well
@mmguero mmguero modified the milestones: v24.05.0, z.staging May 15, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue May 23, 2024
@mmguero mmguero moved this from Todo (investigate) to Done in Malcolm May 30, 2024
@mmguero mmguero self-assigned this May 30, 2024
@mmguero mmguero modified the milestones: z.staging, v24.05.0 May 30, 2024
@mmguero mmguero closed this as completed May 30, 2024
@mmguero mmguero moved this from Done to Released in Malcolm May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Related to speed/performance suricata Relating to Malcolm's use of Suricata
Projects
Status: Released
Development

No branches or pull requests

1 participant