overhead measurement

Joseph Mack mack.joseph at epa.gov
Tue May 28 18:32:33 BST 2002

Tao Zhao wrote:
> Hi, all
> I want to measure the overhead of LVS, e.g. the additional latency imposed
> by LVS instead of a traditional router. I looked up several documents
> and found Zhang's paper mentioned 60us for rewriting a 536 bytes packet.
> All measurements in other documents focuses on throughput instead of
> latency overhead.

This point seems to be missed by most people. I tried to measure the latency


see section 2.1

but found the difference between latency when using the director to 
forward packets as a router and using the director to foward packets
as an LVS director, was too small to measure. My resolution was <100usec
but I couldn't measure it accurately.

> I believe it's not very hard to measure the latency as long as we have a
> fine grain clock. Anyone knows how to get fine grain time?

The attached routine measures the current time with a resolution of usec.
You take the time before and after and subtract the two numbers.

Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center, 
mailto:mack.joseph at epa.gov ph# 919-541-0007, RTP, NC, USA
-------------- next part --------------
/*When is from hint.c */
/* "HINT" -- Hierarchical INTegration.                                        */
/* Copyright (C) 1994 by Iowa State University Research Foundation, Inc.      */

#include <time.h>
#include <sys/time.h>

double when()
	double now;
	struct timeval tp;

	gettimeofday(&tp, NULL);
	//now = ((double) tp.tv_sec + ((double) tp.tv_usec) * 1e-6);
	//printf ("when: now %f \n", now);
	//printf ("when: tv_sec %d tv_usec %d \n", tp.tv_sec, tp.tv_usec);
	return ((double) tp.tv_sec + ((double) tp.tv_usec) * 1e-6);

More information about the lvs-users mailing list