<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Performance on Inliniac</title>
    <link>https://inliniac.net/blog/tag/performance/</link>
    <description>Recent content in Performance on Inliniac</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 23 Dec 2014 15:34:23 +0000</lastBuildDate>
    <atom:link href="https://inliniac.net/blog/tag/performance/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Profiling Suricata with JEMALLOC</title>
      <link>https://inliniac.net/blog/2014/12/23/profiling-suricata-with-jemalloc/</link>
      <pubDate>Tue, 23 Dec 2014 15:34:23 +0000</pubDate>
      <guid>https://inliniac.net/blog/2014/12/23/profiling-suricata-with-jemalloc/</guid>
      <description>&lt;p&gt;JEMALLOC is a memory allocation library: &lt;a href=&#34;http://www.canonware.com/jemalloc/&#34;&gt;http://www.canonware.com/jemalloc/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It offers many interesting things for a tool like Suricata. Ken Steele of EZchip (formerly Tilera) &lt;a href=&#34;https://github.com/inliniac/suricata/pull/1233&#34;&gt;made me aware of it&lt;/a&gt;. In Ken&amp;rsquo;s testing it helps performance.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Install&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wget http:&lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt;www&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;canonware&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;com&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;download&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;jemalloc&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;jemalloc&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;3.6&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0.&lt;/span&gt;tar&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;bz2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;tar xvfj jemalloc&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;3.6&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0.&lt;/span&gt;tar&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;bz2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd jemalloc&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;3.6&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;./&lt;/span&gt;configure &lt;span style=&#34;color:#f92672&#34;&gt;--&lt;/span&gt;prefix&lt;span style=&#34;color:#f92672&#34;&gt;=/&lt;/span&gt;opt&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;jemalloc&lt;span style=&#34;color:#f92672&#34;&gt;/&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;make&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo make install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then use it by preloading it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;LD_PRELOAD=/opt/jemalloc/lib/libjemalloc.so ./src/suricata -c suricata.yaml -l tmp/ -r ~/sync/pcap/sandnet.pcap -S emerging-all.rules -v&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I haven&amp;rsquo;t benchmarked this, but if you&amp;rsquo;re running a high performance setup it may certainly be worth a shot.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata 1.4 development update</title>
      <link>https://inliniac.net/blog/2012/10/04/suricata-1-4-development-update/</link>
      <pubDate>Thu, 04 Oct 2012 16:51:40 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/10/04/suricata-1-4-development-update/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/suricata2.png&#34;&gt;&lt;img src=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/suricata2.png&#34; alt=&#34;&#34;&gt;&lt;/a&gt; Today, a day after &lt;a href=&#34;https://inliniac.net/blog/2012/10/03/suricata-1-3-2-is-out/&#34;&gt;1.3.2&lt;/a&gt;, we&amp;rsquo;ve released &lt;a href=&#34;http://suricata-ids.org/2012/10/04/suricata-1-4beta2-available-for-testing/&#34;&gt;1.4beta2&lt;/a&gt;. While 1.3.2 is an important update for those running 1.3.1 or lower, today&amp;rsquo;s release is where things get exciting. A lot of things were improved and added. Let me show some numbers first.&lt;/p&gt;&#xA;&lt;p&gt;The 1.4beta2 release is a pretty big update over 1.4beta1 as it touches over 5k lines of code:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;234 files changed, 5033 insertions(+), 3759 deletions(-)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compared to 1.4beta2 vs yesterday&amp;rsquo;s 1.3.2 it&amp;rsquo;s clear over 11k lines of code are touched:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata luajit update</title>
      <link>https://inliniac.net/blog/2012/09/21/suricata-luajit-update/</link>
      <pubDate>Fri, 21 Sep 2012 14:49:54 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/09/21/suricata-luajit-update/</guid>
      <description>&lt;p&gt;After an exciting week of meeting and working with the team around the RAID conference, time for another lua update.&lt;/p&gt;&#xA;&lt;p&gt;The keyword supports an interesting set of buffers now:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;packet&#xA;payload&lt;/p&gt;&#xA;&lt;p&gt;http.uri&#xA;http.uri.raw&#xA;http.request_line&#xA;http.request_headers&#xA;http.request_headers.raw&#xA;http.request_cookie&#xA;http.request_user_agent&#xA;http.request_body&lt;/p&gt;&#xA;&lt;p&gt;http.response_headers&#xA;http.response_headers.raw&#xA;http.response_body&#xA;http.response_cookie&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;The http keywords are now integrated into their respective inspection engines. This led to one important limitation for now: you can only inspect one such buffer per script.&lt;/p&gt;</description>
    </item>
    <item>
      <title>First impressions of lua(jit) performance in Suricata</title>
      <link>https://inliniac.net/blog/2012/09/08/first-impressions-of-luajit-performance-in-suricata/</link>
      <pubDate>Sat, 08 Sep 2012 09:05:09 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/09/08/first-impressions-of-luajit-performance-in-suricata/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/09/lua.gif&#34;&gt;&lt;img src=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/09/lua.gif&#34; alt=&#34;&#34;&gt;&lt;/a&gt; Today I decided to look into the potential performance of the luajit keyword a bit. It&amp;rsquo;s important to know if this can perform at reasonable speeds so that we can actually use it in real deployments. Even if we can&amp;rsquo;t the feature may still be appealing though, for offline pcap analysis.&lt;/p&gt;&#xA;&lt;p&gt;So far, the results are rather encouraging.&lt;/p&gt;&#xA;&lt;p&gt;First, I added 2 buffers today: http.uri, which contains the normalized uri (same buffer as the http_uri content modifier inspects) and http.request_line, which is the request line given to us by libhtp. This contains method, separators, uri, HTTP version.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata 1.3.1 is out</title>
      <link>https://inliniac.net/blog/2012/08/21/suricata-1-3-1-is-out/</link>
      <pubDate>Tue, 21 Aug 2012 10:48:27 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/08/21/suricata-1-3-1-is-out/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/suricata2.png&#34;&gt;&lt;img src=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/suricata2.png&#34; alt=&#34;&#34;&gt;&lt;/a&gt; Since this morning Suricata 1.3.1 is available. The main focus of this release was fixing a number of bugs. See the &lt;a href=&#34;https://redmine.openinfosecfoundation.org/versions/32&#34;&gt;list of closed bugs&lt;/a&gt;, the &lt;a href=&#34;http://www.openinfosecfoundation.org/index.php/component/content/article/1-latest-news/161-suricata-131-available&#34;&gt;release notes&lt;/a&gt; and the &lt;a href=&#34;https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Upgrading_Suricata_13_to_Suricata_131&#34;&gt;upgrade instructions&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As a bonus, I applied a set of patches by &lt;a href=&#34;https://home.regit.org/&#34;&gt;Eric Leblond&lt;/a&gt;. Eric has been trying to push AF_PACKET to the limit and has achieved some spectacular results with it. Read all about his quest to get to 10Gbps here on &lt;a href=&#34;https://home.regit.org/2012/07/suricata-to-10gbps-and-beyond/&#34;&gt;Eric&amp;rsquo;s blog&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata http_user_agent vs http_header</title>
      <link>https://inliniac.net/blog/2012/07/09/suricata-http_user_agent-vs-http_header/</link>
      <pubDate>Mon, 09 Jul 2012 18:43:12 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/07/09/suricata-http_user_agent-vs-http_header/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/ua-ws.png&#34;&gt;&lt;img src=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/07/ua-ws.png?w=300&#34; alt=&#34;&#34;&gt;&lt;/a&gt; One of the new features in Suricata 1.3 is a new content modifier called &lt;em&gt;http_user_agent&lt;/em&gt;. This allows rule writers to match on the User-Agent header in HTTP requests more efficiently. The new keyword is documented in the OISF &lt;a href=&#34;https://redmine.openinfosecfoundation.org/projects/suricata/wiki/HTTP-keywords&#34;&gt;wiki&lt;/a&gt;. In this post, I&amp;rsquo;ll show it&amp;rsquo;s efficiency with two examples.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example 1: rarely matching UA&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Consider a signature where the match if on a part of the UA that is very rare, so not part of regular User Agents. In my example &amp;ldquo;abc&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata scaling improvements</title>
      <link>https://inliniac.net/blog/2012/05/29/suricata-scaling-improvements/</link>
      <pubDate>Tue, 29 May 2012 15:52:52 +0000</pubDate>
      <guid>https://inliniac.net/blog/2012/05/29/suricata-scaling-improvements/</guid>
      <description>&lt;p&gt;For the Suricata 1.3beta1 release, one of our goals was to improve the scalability of the engine when running on many cores. As the graph below shows, we made a good deal of progress.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/05/suri11vs13.png&#34;&gt;&lt;img src=&#34;https://inliniac.net/blog/blog/wp-content/uploads/2012/05/suri11vs13.png&#34; alt=&#34;&#34;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The blue line is an older 1.1 version, the yellow line is 1.3dev. It clearly shows that 1.1 peaked at 4 cores, then started to get serious contention issues. 1.3dev scales nicely beyond that, up to 24 cores in this test (four 6core AMD cpu&amp;rsquo;s). Tilera recently demonstrated Suricata on their many core systems, running a single Suricata process per cpu. Their cpu&amp;rsquo;s have 36 real cores.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata and PCRE performance</title>
      <link>https://inliniac.net/blog/2011/10/12/suricata-and-pcre-performance/</link>
      <pubDate>Wed, 12 Oct 2011 18:26:19 +0000</pubDate>
      <guid>https://inliniac.net/blog/2011/10/12/suricata-and-pcre-performance/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Will Metcalf &lt;a href=&#34;https://twitter.com/#!/node5/status/124193666377064448&#34;&gt;pointed out&lt;/a&gt; I was missing the &amp;ndash;enable-utf8 &amp;ndash;enable-unicode-properties flags from PCRE, so added these &amp;amp; updated the numbers. Thanks Will.&lt;/p&gt;&#xA;&lt;p&gt;In the Emerging Threats community the following if often heard: &amp;ldquo;PCRE is evil&amp;rdquo;. With this people refer to signatures that use &amp;ldquo;pure&amp;rdquo; PCRE matches, meaning without anchoring it to a content pattern match.&lt;/p&gt;&#xA;&lt;p&gt;A while ago Will Metcalf initiated work to get Suricata to support a new PCRE feature by Herczeg Zoltán: &lt;a href=&#34;http://sljit.sourceforge.net/pcre.html&#34;&gt;SLJIT&lt;/a&gt;. Since then, support for this has found it&amp;rsquo;s way into the official PCRE release, currently at version &lt;a href=&#34;https://lists.exim.org/lurker/message/20111011.103546.de2e9e31.en.html&#34;&gt;8.20-RC3&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suricata development update</title>
      <link>https://inliniac.net/blog/2010/12/18/suricata-development-update/</link>
      <pubDate>Fri, 17 Dec 2010 22:39:48 +0000</pubDate>
      <guid>https://inliniac.net/blog/2010/12/18/suricata-development-update/</guid>
      <description>&lt;p&gt;The last months we&amp;rsquo;ve been working hard on improving Suricata. So hard actually, that we&amp;rsquo;ve drifted a bit from our original goal of doing a 1.0.3 &amp;ldquo;maintenance&amp;rdquo; release. Instead, the new release will be 1.1beta1. The change to 1.1 is to indicate the large number of changes, the beta1 is to &amp;hellip; indicate the large number of changes :)&lt;/p&gt;&#xA;&lt;p&gt;As you may know, Will Metcalf moved on to join Qualys. A significant loss to our project as Will was one of our founding members and is hard to replace in his role as QA lead. Not having a full time QA person on the team right now is a reason for us to decide we&amp;rsquo;re in need of a beta cycle for the next release.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Speeding up Suricata with tcmalloc</title>
      <link>https://inliniac.net/blog/2010/10/21/speeding-up-suricata-with-tcmalloc/</link>
      <pubDate>Thu, 21 Oct 2010 12:10:33 +0000</pubDate>
      <guid>https://inliniac.net/blog/2010/10/21/speeding-up-suricata-with-tcmalloc/</guid>
      <description>&lt;p&gt;&amp;rsquo;tcmalloc&amp;rsquo; is a library Google created as part of the &lt;a href=&#34;http://code.google.com/p/google-perftools/&#34;&gt;google-perftools suite&lt;/a&gt; for speeding up memory handling in a threaded program. It&amp;rsquo;s very simple to use and does work fine with Suricata. Don&amp;rsquo;t expect magic from it, but it should give you a few percent more speed.&lt;/p&gt;&#xA;&lt;p&gt;On Ubuntu, install the libtcmalloc-minimal0 package:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;apt-get install libtcmalloc-minimal0&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Then run Suricata as follows (on a single line):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;LD_PRELOAD=&amp;quot;/usr/lib/libtcmalloc_minimal.so.0&amp;quot; ./src/suricata -c suricata.yaml -i eth0&lt;/p&gt;</description>
    </item>
    <item>
      <title>Improving Suricata performance with bitmask based signature prefiltering</title>
      <link>https://inliniac.net/blog/2010/10/01/improving-suricata-performance-with-bitmask-based-signature-prefiltering/</link>
      <pubDate>Fri, 01 Oct 2010 09:49:26 +0000</pubDate>
      <guid>https://inliniac.net/blog/2010/10/01/improving-suricata-performance-with-bitmask-based-signature-prefiltering/</guid>
      <description>&lt;p&gt;The last weeks I&amp;rsquo;ve been spending quite a bit of time improving Suricata&amp;rsquo;s performance, making good progress. I did a lot of optimizations all over the code, but the most significant is a new way of prefiltering signatures for inspection. I&amp;rsquo;ll briefly explain the concept here.&lt;/p&gt;&#xA;&lt;p&gt;But first a quick explanation of how Suricata selects signatures for inspection. When Suricata starts, it organizes signatures into groups, called SigGroupHead in the code. To reduce the number of signatures that need inspection for each packet, the grouping is done on quite a few properties: flow direction, protocol, src ip, dst ip, src port, dst port. Even though this grouping is quite aggressive, a single SigGroupHead can still contain many thousands of signatures. For example Emerging Threats web-client sigs will almost all end up in the same SigGroupHead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>On Suricata performance</title>
      <link>https://inliniac.net/blog/2010/07/22/on-suricata-performance/</link>
      <pubDate>Thu, 22 Jul 2010 08:26:54 +0000</pubDate>
      <guid>https://inliniac.net/blog/2010/07/22/on-suricata-performance/</guid>
      <description>&lt;p&gt;Lots of fuzz in the media about Suricata&amp;rsquo;s performance versus Snort yesterday. Some claiming Suricata is much faster, others claiming Snort is much faster.&lt;/p&gt;&#xA;&lt;p&gt;At this point I really don&amp;rsquo;t care much. What the Suricata development by the OISF has shown in my opinion is that we&amp;rsquo;ve managed to create a very promising new Open Source project out here. In little over a year, funded for about $600k by the US government and with heavy (and growing) industry support, we&amp;rsquo;ve produced a new IDS/IPS engine mostly compatible with Snort but build on a all new code base an incorporating some very interesting fresh ideas. We&amp;rsquo;re already seeing a community form around our project with a lot of support from that new community.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Modsec2sguil for HTTP transaction logging</title>
      <link>https://inliniac.net/blog/2007/08/15/using-modsec2sguil-for-http-transaction-logging/</link>
      <pubDate>Wed, 15 Aug 2007 13:05:08 +0000</pubDate>
      <guid>https://inliniac.net/blog/2007/08/15/using-modsec2sguil-for-http-transaction-logging/</guid>
      <description>&lt;p&gt;Modsec2sguil is currently configured to send alerts to Sguil. ModSecurity can be configured to log any event or transaction, including 200 OK, 302 Redirect, etc. Modsec2sguil distinguishes between alerts and other events by only processing HTTP codes of 400 and higher. Since 0.8-dev2 there is a configuration directive to prevent certain codes, such as 404, from being treated as an alert.&lt;/p&gt;&#xA;&lt;p&gt;Now I have the following idea. Since ModSecurity can log all events with details of request headers, response headers and POST message body, it may be interesting to just send all these events to Sguil. They should not be appearing as alerts, but having them in the database can perhaps be interesting. I know using flow data and full packet captures the same data can be accessed, but having it in the database makes querying it a lot easier and longer available.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
