netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Ransburg" <michael.ransburg@gmail.com>
To: "Netfilter Developer Mailing List" <netfilter-devel@lists.netfilter.org>
Subject: Measure CPU load of a filter application based on libipq
Date: Mon, 3 Sep 2007 10:15:01 +0200	[thread overview]
Message-ID: <22b256140709030115o63fb1a09p9bd623ed317988f7@mail.gmail.com> (raw)

Hi all,

I'm on a Fedora Core 6 i386 machine. I have implemented a packet
filter based on libipq which works great. It basically looks into the
IP and UDP header of each packet and decides on its fate based on
this.

I'm now trying to get some simple measurements of the performance of
this filter. Basically I use "ps hu -p $pid" to periodically (every
0.1 seconds) output the CPU load and memory consumption (where $pid is
the process ID of the filter) to a file.

This works fine for memory consumption, however for CPU load I always
get 0. The filter is processing about 100 UDP/IP packets / second. I'm
aware that the CPU load of ps corresponds to the CPU time divided by
the runtime of the process, so I made sure to restart the filter
before starting the measurements.

When I artificially introduce extra CPU load to my filter (by calling
some functions of a library which I know are CPU intensive), then the
CPU load goes up, as expected.

Can anyone shed some light on this? Is the CPU load really that low
(very close to 0) for the above filter? Or is ps unable to measure
some of the CPU load of my filter because it is "kernel" CPU load (I'm
obviously guessing here).

Any hints / inputs on what is going wrong and on how I can get an idea
of the CPU load of my libipq filter application would be great.

Many thanks,
Michael

-- 
icq: 71772353 | skype: daneel1409 | msn: mike@unfolded.com

                 reply	other threads:[~2007-09-03  8:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22b256140709030115o63fb1a09p9bd623ed317988f7@mail.gmail.com \
    --to=michael.ransburg@gmail.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).