Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 505289FB2E5 for ; Fri, 6 Jul 2007 15:35:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 93674-10 for ; Fri, 6 Jul 2007 15:35:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp113.plus.mail.re1.yahoo.com (smtp113.plus.mail.re1.yahoo.com [69.147.102.76]) by postgresql.org (Postfix) with SMTP id 0602C9FB33B for ; Fri, 6 Jul 2007 15:35:41 -0300 (ADT) Received: (qmail 68131 invoked from network); 6 Jul 2007 18:35:41 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=Yahoo.com; h=Received:X-YMail-OSG:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=stduc84YM8C96nV5oUnawTEjCsS059PgI55usXt4zbIZ+Z7E3ySe/ZoRJOq5CcpMVAHoqHnTa8uzV1RQQlnUd5nEQGdcvYGjWD3nmchywlLsyThNmWMkn0l4SUhFDM4r8I/bT1L6H5z1iMBLtO5M+gxX1Pz+u6xrehwihuD8x84= ; Received: from unknown (HELO jupiter.jannicash.info) (janwieck@68.34.254.79 with login) by smtp113.plus.mail.re1.yahoo.com with SMTP; 6 Jul 2007 18:35:40 -0000 X-YMail-OSG: ZfZhRAQVM1n9UJiXdtA6i.g31KUSY7LRZ5TVO1Rt0fPT9fDQwNA_oXOwQ2e2EkYptuRoRjnO2g-- Received: from [172.21.8.128] (mars.jannicash.info [192.168.192.101]) (authenticated bits=0) by jupiter.jannicash.info (8.12.10/8.12.9) with ESMTP id l66IZZHY018373; Fri, 6 Jul 2007 14:35:39 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <468E8B71.90602@Yahoo.com> Date: Fri, 06 Jul 2007 14:35:29 -0400 From: Jan Wieck User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Heikki Linnakangas CC: Peter Eisentraut , pgsql-hackers@postgresql.org Subject: Re: usleep feature for pgbench References: <468D42B3.4010701@Yahoo.com> <200707061644.57878.peter_e@gmx.net> <468E7AC3.3040501@Yahoo.com> <468E7CAB.9070802@enterprisedb.com> In-Reply-To: <468E7CAB.9070802@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.489 tagged_above=0 required=5 tests=AWL=-1.261, BAYES_20=-0.74, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447, FORGED_RCVD_HELO=0.135 X-Spam-Level: * X-Archive-Number: 200707/172 X-Sequence-Number: 105087 On 7/6/2007 1:32 PM, Heikki Linnakangas wrote: > Jan Wieck wrote: >> On 7/6/2007 10:44 AM, Peter Eisentraut wrote: >>> Am Donnerstag, 5. Juli 2007 21:12 schrieb Jan Wieck: >>>> To test some changes in Slony I needed a >>>> >>>> \usleep [microseconds|:variable] >>>> >>>> in pgbench's scripting language to be able to have hundreds of >>>> concurrent running transactions without totally swamping the system. I >>>> was wondering if anyone would object to permanently adding this to the >>>> pgbench code? >>> >>> Or maybe a \sleep command that takes units, if it's not too much work. >>> >> >> You mean as a second, optional argument? Good idea. >> >> us = microseconds >> ms = milliseconds >> s = seconds (default) >> >> \sleep {value|:variable} [us|ms|s] >> >> Is that okay with everyone? > > I won't object, but is it really worth the trouble? > > Can you do microsecond precision sleeps, and on what platforms? How much > overhead is there? IIRC, on Linux the minimum time you can sleep depends > on CONFIG_HZ, and the default was 10 ms until recently. > It is what you tell select(2) in the struct timeval. Why limit it to some arbitrary precision? Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #