in reply to newbie question about mulit-thread udp server
Netflow data, hmm? I've dealt with that, and the traffic can get pretty heavy. Your best bet is to make not exactly a multithread server, but a server thread that accepts each packet, and as quickly as possible puts it somewhere to be processed. (This could be through shared memory, pipes, databases or files - But SHM and pipes just removes the problem one layer deeper).
In a multithreaded server, that means one receiving thread, and possibly multiple processing threads. Or you could have a singlethreaded server which simply stores the info somewhere to be processed.
Where you store it depends on how many packets we're talking about, how much space you have to store them, and how much pre-processing you intend to do.
If you're getting a significant ammount of netflow (we get a lot even at 300:1 sampling) I would advise against storing it in a database directly - they are just not fast enough. You could use a system of rotating DB_File databases, or just dump to a file, and process it later.
HTH.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: newbie question about mulit-thread udp server and documention of io::socket
by iwanthome (Beadle) on Mar 24, 2004 at 08:19 UTC | |
by matija (Priest) on Mar 24, 2004 at 09:19 UTC | |
by Anonymous Monk on Mar 24, 2004 at 09:06 UTC |