LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: overhead measurement

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: overhead measurement
From: Joseph Mack <mack.joseph@xxxxxxx>
Date: Tue, 28 May 2002 13:32:33 -0400
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

http://www.linuxvirtualserver.org/Joseph.Mack/performance/single_realserver_performance.html

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.

Joe
-- 
Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center, 
mailto:mack.joseph@xxxxxxx ph# 919-541-0007, RTP, NC, USA
/*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);
}

<Prev in Thread] Current Thread [Next in Thread>