You've read the docs and traffic, but it's clearly not quite clicking...
let's see...

> --disable-decoders
> --disable-sessions
> --numeric-ip-addresses

Those options reduce the per-packet processing load, but they don't reduce
the number of hosts ntop is tracking.

Broadly it's not what the hosts are doing but their number that eats memory.
(Yeah, strictly speaking, some of the less common tracking is done in
HostTraffic extension tables that won't be allocated, but... go with the
basics here).

Quoting docs/FAQ:

"Q. So ntop's memory usage is dependent upon?
A. ntop's memory usage for host tables depends on the # of hosts it sees in
   packet traffic.  This is NOT, repeat NOT controllable by ntop in ANY way.
   If a user kicks off a port scan, 100s of hosts appear.  If somebody does
a
   DOS attack against you, 1000s of hosts 'appear'.  If a user searches
Kazza
   for an obscure song, it can probe 4K hosts. etc.

   Lots of those hosts appear, have a few bytes of traffic and then
disappear.
   Each host has a variable amount of memory - there's a base structure,
some
   optional counter structures and a large # of pointer fields, which may or
   may not be valued for any given host.  It depends on the # of active
   sessions and a lot of other things, but 8-20K is a good guess - I usually
   use 12K as an guestimating size.  Similarly, sessions may appear and
   disappear (http: opens a lot, does a small retrieval and closes them),
ssh
   may last for days.  etc.   Memory is consumed tracking them too."

With 1GB of RAM, how many hosts can you track?  My guess would be around
60K.  (Real #s would be in the configuration page, either info.html or
textinfo.html)

Now THINK a minute about how many hosts you are trying to track - every
source (your 5K users) PLUS each and every destination to and from them.
It's almost certainly more than you think.

Go out to Yahoo! and look at the source for their 'home page'.  Besides
www.yahoo.com, there are OBVIOUS references to

p3p.yahoo.com
us.i1.yimg.com
us.a1.yimg.com

Do an nslookup on those and you find 25 unique IP addresses.

That's one, albeit common and busy, site... multiply that across your 5K
userbase and why are you surprised you touch a lot of hosts?


You're an ISP, so you should have some clues about your traffic patterns.
Yeah, 1000s of users are going to hit the same five or ten sites, but beyond
that, the fan-out is huge.

You also web host for customers.  If your customers are successful, then
thousands of Internet users are going to visit their web sites.  Especially
if you have enough traffic to justify a DS3... (45 Mbps).  That's an even
larger fan-in.


The problem is that once a host is recognized, it's there forever...  even
if it's just a few KB of traffic last Tuesday...


What's ntop's defense against this?  Idle Host Purge.  Read the next entry
in docs/FAQ:

"Q. So what does the purge do?
A. ntop purges idle hosts.  Period.

   Idle being defined as having not had packet traffic for a #define able
   period, 5 minutes by default.

   Because of the amount of linked data, these purges take time (lots of
   free() calls on all those char* values), so we don't purge in 'real
time'.
   First we build a list of idle hosts, then we purge from that list.
   Any idle host is eligible for purge (unless you tell ntop not to purge
idle
   hosts, which is usable only on small networks).

   Over time, all idle hosts are purged.  Only to be perturbed by the
   next burst of activity - say a port scan or everybody logging in back
   in after lunch.  Eventually, there's some form of steady state, but it's
   HIGHLY dependent upon network activity.  Which, remember, is external to
   ntop and can't be predicted."

Now the entry 2 on is outdated...

"Q. So how about a hard memory limit?
A. There's no way to make a hard limit without purging ACTIVE hosts (or
   non-IDLE given ntop's definition of idle).

   Think about it ... you're at that 1GB limit and you find a new host.
   Do you kick off an interim purge (with it's huge overhead?)  And wait
   2 or 3 s for an available slot??  While 1000s of other packets appear??"

I was thinking of something subtle here.

It turns out to be possible - and has been implemented - just to put a 'dumb
as a box of rocks' fence in place.  These are the -x and -X switches (man
ntop).  No smarts about it.  10K hosts allowed to be tracked, drop number
10001.  If that 10001th host happens to be your most important business
partner, tough.  That Kazza user searching 10000 sites around the world for
some oddball Dr. Demento clip just ate all your host slots.

But it will limit ntop's usage...



Devdas was on the right track - filter your ntop instance to what you care
about.  That's a highly individual decision.  There's no single, simple,
answer, you'll have to think about your traffic and limit it to what you can
afford the RAM to track...

Be careful with your filter - people forget that the filter is applied to
the packet as a whole and so his suggestion, -B "net 192.168.0.0/16 or net
202.142.105.80/28" will still see all packets from the RFC1918 space to
anywhere.  -B "net src 202.142.105.80/28" might be better - only stuff
originating from his space.  Or it might not be - he might be more concerned
about people accessing his web server.

Look into --track-local-hosts (man ntop) - if you care about the bandwidth
your users are using, but not really about where they're using it, and/or
who is accessing them, this might be what you need.


If you're looking for more than best-efforts support, perhaps we should talk
offlist about commercial support?


-----Burton

US-based commercial support for ntop:
     http://www.ntopsupport.com
     mailto:[EMAIL PROTECTED]

Search the ntop mailing lists at gmane:
     http://search.gmane.org

(nearly current) ntop FAQ including "HowTo Ask for Help" at
     http://www.ntopsupport.com/faq.html











> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
> Adam Towarnyckyj
> Sent: Thursday, June 17, 2004 4:53 PM
> To: [EMAIL PROTECTED]
> Subject: [Ntop] NTOP Resource Usage
>
>
> Hello everyone,
>       I was wondering if I could get some suggestions on a problem I'm
> having. I'd like to start off by first stating that I have dug into the
> archives and couldn't find a suitable answer to my questions and I have
> also read the FAQ with the same result. I did read the (mis)usage guide
> and tried the suggestions in there to no avail. So, here's my situation.
>       I work at an ISP and we just implemented bandwidth management.
> Our customers are finally getting only what they pay for. (yay!) I'm
> running a Pentium 4 2.8ghz with 1 GB of ram. The problem I'm having is
> that when I start NTOP, it gradually eats memory until it gets into the
> swap partition and eats about half of that as well. I saw a post like
> this earlier in this list and the answer was "read prior posts". I
> couldn't find anything before that one.
>       I've used the following options in order to try and slim down
> NTOP:
> --disable-decoders
> --disable-sessions
> --numeric-ip-addresses
>       These have all been suggested in the (mis)usage guide. These
> options didn't help at all and I still run into the same problem. The
> machine is set up with two network cards bridged together running from
> the router to our local network. We have about 5000 connections trying
> to access the internet through this bridge at one time.
>       My question is: can anyone suggest a method to trim down NTOP
> more so that I can run it on the machine and not kill the ram and swap
> file? The way it is now, I can't even generate reports without a timeout
> occurring.
>       I would also like to know if this is the best way to be going
> about this. Will NTOP do what I am asking of it with such a large
> network or should I find another alternative? And if this is the case,
> anyone have any suggestions?
>       Any help would be greatly appreciated and I do apologize if I am
> repeating a prior post. Have a great day.
>
> Adam Towarnyckyj
>
>
>
> _______________________________________________
> Ntop mailing list
> [EMAIL PROTECTED]
> http://listgateway.unipi.it/mailman/listinfo/ntop

_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop
  • RE: [Ntop] NTOP Resource Usage Burton M. Strauss III

Reply via email to