Guest User!

You are not Sophos Staff.

[8.281][DUPLICATE][NOT A BUG] Snort memory usage

I believe I had this problem starting with 8.1 and then I stopped using snort altogether and didn't test it for 8.2 beta so here is the problem again for 8.3 beta.

Reloading snort uses significantly more ram compared to a normal start.

1.The first screenshot below shows the memory usage after regular start by enabling IPS in webadmin.

2 & 3. Reload IPS by adding another interface or change an attack pattern rule and two instances of snort spawn. This consumes large amounts of cpu and ram and finally only one instance is left. But the memory consumption increases dramatically after the reload.

Regards
Bill.
Parents
  • I believe I had this problem starting with 8.1 and then I stopped using snort altogether and didn't test it for 8.2 beta so here is the problem again for 8.3 beta.

    Reloading snort uses significantly more ram compared to a normal start.


    Yes.  it is a side effect of how the reload feature is implemented.
    The only "solution" is to do full restarts, which is unwanted because it can cut off internet
    access for several minutes on the smaller machines.
  • Aha!!! I figured that's why two instances were running on the reload to keep that traffic flowing. I found the original thread from 8.1 beta https://community.sophos.com/products/unified-threat-management/astaroorg/f/109/t/70059 [[:D]][[:D]]

    So this is an undisclosed bug with maybe a fix in v9 then?

    Regards
    Bill
  • Aha!!! I figured that's why two instances were running on the reload to keep that traffic flowing. I found the original thread from 8.1 beta http://www.astaro.org/closed-forums-read-only/asg-v8-betas/asg-v8-100-beta-closed/asg-v8-100-beta-closed-threads/34391-8-050-bug-open-snort-memory-usage-restart.html [[:D]][[:D]]

    So this is an undisclosed bug with maybe a fix in v9 then?


    Its not a bug.

    When you make changes in the ips tab, three things can happen:
    1. - snort is not restarted.  This happens eg. when adding exceptions for particular hosts or networks, as this is done via netfilter rules only those have to be changed and snort is left alone.
    2. - you've added or removed ips rules.
         snort will be reloaded by means of "pkill -SIGHUP snort"
         In this case, snort will continue to work -- it reloads the new configuration data in the background by means of a "reload thread".  Because snort is still using the existing ruleset, the changed rules need to be stored in addition to the current rules.
         This is the main reason for the memory increase.  There will be no increase on subsequent reloads, as the old, phased-out-ruleset can be re-used.
    3. certain tuneables in snorts configuration have changed that snort cannot deal with at run time.
    In this case, a 2nd snort process is started. Once its up an handling traffic, the "real" snort
    process will be shut down and started from scratch.  Once its up again, the temporary one exits.

    case 3) also has the additional memory requirements, but memory is reclaimed faster since the snort process is removed/restarted completely.
  • Its not a bug....When you make changes in the ips tab, three things can happen...

    Thanks for the detailed explanation. Is this the default snort behavior or the way it is reloaded in astaro to keep traffic flowing that makes the memory usage go up with subsequent reloads.
    Snort is memory intensive as the rulesets are loaded into ram to minimize packet processing delays.  As the rulesets get more complex the usage goes up. 
    You are right but in this case, you can actually remove a rule and reload and the usage goes up[:P]

    If you are going to use snort make sure you have plenty of ram. If you are going to use http proxy and snort 2 gigs is the absolute minimum. This requirement is going to be going up..that much you can count on. Right now if i can swing it i now deploy default 4 gigs and 64 bit
     Amen to that!!!

    Regards
    Bill
  • Thanks for the detailed explanation. Is this the default snort behavior or the way it is reloaded in astaro to keep traffic flowing that makes the memory usage go up with subsequent reloads.


    The one-time memory increase on a reload via SIGHUP is default behaviour of snort.

    We could revert back to a full stop/start cycle as in V7 but this would make traffic stop for some time.
  • The one-time memory increase on a reload via SIGHUP is default behaviour of snort.

    We could revert back to a full stop/start cycle as in V7 but this would make traffic stop for some time.


    Perhaps this could be a setting in cc for users with low ram?

    Barry
Reply Children
No Data