From owner-freebsd-hackers Wed May 5 4:37:59 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from fwns1.raleigh.ibm.com (fwns1d.raleigh.ibm.com [204.146.167.235]) by hub.freebsd.org (Postfix) with ESMTP id EF77214CC7 for ; Wed, 5 May 1999 04:37:56 -0700 (PDT) (envelope-from nadas@raleigh.ibm.com) Received: from rtpmail03.raleigh.ibm.com (rtpmail03.raleigh.ibm.com [9.37.172.47]) by fwns1.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id HAA32304; Wed, 5 May 1999 07:37:40 -0400 Received: from roundout (roundout.raleigh.ibm.com [9.37.176.120]) by rtpmail03.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with SMTP id HAA33622; Wed, 5 May 1999 07:37:41 -0400 Message-Id: <199905051137.HAA33622@rtpmail03.raleigh.ibm.com> From: "Stephen Nadas" To: mike@smith.net.au, luigi@labinfo.iet.unipi.it Date: Wed, 5 May 1999 07:39:01 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: High resolution timers Reply-To: nadas@raleigh.ibm.com Cc: lli@ralvm6.rscs, vperis@watson.ibm.com, Brian Adamson , freebsd-hackers@freebsd.org In-reply-to: References: <199905032133.RAA29164@rtpmail03.raleigh.ibm.com> X-mailer: Pegasus Mail for Win32 (v3.01d) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mike, Luigi, We run around a dozen or more FreeBSD machines (2.2.8 CD level) in a networking lab. Mostly these are pentiums of speed 75mhz-200mhz. We use xntpdc to synchronize their clocks to one of these machines (so it is important they be synchronized, but only to each other). We also use a tool called MGEN to generate traffic. This tool uses the select system call. On a faster pentium (180mhz) repeated calls to gettimeofday suggest that the gettimeofday() call takes about 6 usecs. But similar measurements show that a select system call takes at least 20 millisec. This 20msec is causing the application to send very bursty traffic for higher packet rates because when it wakes up from select there are many packets to send. This burstiness is undesirable in our testing. So, my main question is: Why is this 20 millisec? (there's quite a few older appends about this that don't resolve much) What can I do to make it shorter? I have read quite a few appends on high resolution timing and a solution remains unclear. Since you both have posted the hackers list on this subject so I am hopeful you can suggest a solution direction. I gather that the sysgen option HZ controls the number of ticks per sec that the kernel sees? (why is this option not in LINT?) and for higher granularity some appends suggest to increase HZ. Other appends suggest doing so will screw up xntpdc (is this true if all the machins involved use the same HZ?) There are some references to other functions e.g., microtime() but no man pages - where are these? can they be used in application code safely? Thanks in advance. Best Regards, Steve Nadas ip: nadas@raleigh.ibm.com / VM: nadas at rtp/notes: nadas@ibmusm23 +1-919-254-2363 / Tieline: 8-444-2363 / Fax: use X-5483 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message