I think it's a marginal idea. 1) Transferring work from a periodic process to every packet is the inverse of our typical performance improvement.
2) The maintenance of the linked list would require locking the ENTIRE HostTraffic structure for every packet (remember, the case of multiple NICs and SMP). Back of the envelope says that's a significant hit ... The overhead from a pthread_mutex_lock()/pthread_mutex_unlock() call is around 0.000003s per call on my 1GHz P3. So full bore 100BaseT is around 9K packets / second, that's 0.05s per s of additional overhead. Of course, you could always give it a try and do the measurements on it, but my gut says nope. -----Burton -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Iaru Sent: Thursday, March 10, 2005 3:22 PM To: [email protected] Cc: [EMAIL PROTECTED] Subject: [Ntop] ntop memory management Hello, Regarding the way ntop updates/adds/deletes hosts, I was wondering whether this approach has been tried : when updating a host also move it to the top of the list, as if it was being added and thus make sure the oldest hosts are always at the bottom of the list. Whenever purgeIdleHosts() is called, it can go through the list looking for the first host that does not need to be deleted and then do a while loop and delete all the previous hosts, possibile without needing theFlaggedHosts[]. Let me know what you think of this. Thanks, Stefan. ------------------------ Stefan Iaru http://www.iaru.net _______________________________________________ Ntop mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop _______________________________________________ Ntop mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop
