Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 344B99FB47B for ; Fri, 6 Jul 2007 14:33:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 02022-07 for ; Fri, 6 Jul 2007 14:33:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 86F719FB46F for ; Fri, 6 Jul 2007 14:33:29 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so821764ugf for ; Fri, 06 Jul 2007 10:33:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=Pvg809v+xYPYbksmaAJwa9AwfJcqqcSc2RfZN3TDDV7GqJUkHE5Ajc4HAKSBwZXjQShjTvqMjtJ+j0nE0Iyhx10gIag/VBAVVtGSgnXhhNnLJBQM+ghggMRwndlEEypNIUsYy+9ZgJxDNcnIjo/sMVdywp2vTs7qhioR8stYQkY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=jFIPuajV9S4fDPYBmJw4epW/iqtV3jUylLax7vRgSOTREOXm0BHx1atHzx36F8ygF4zurTNZ2ASR3z94TkcYpbI6TvE0TrisUUku1RiHWkiH/3VtuKfytv2IcTlqbTeLkGmIbYI1KbJ3dT2OtU/NoJ8wh2lEm/i+U93AtTfe/Gk= Received: by 10.67.89.5 with SMTP id r5mr2882976ugl.1183743208072; Fri, 06 Jul 2007 10:33:28 -0700 (PDT) Received: from ?192.168.1.33? ( [86.31.148.180]) by mx.google.com with ESMTPS id k30sm1040563ugc.2007.07.06.10.33.22 (version=SSLv3 cipher=RC4-MD5); Fri, 06 Jul 2007 10:33:24 -0700 (PDT) Message-ID: <468E7CAB.9070802@enterprisedb.com> Date: Fri, 06 Jul 2007 18:32:27 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Jan Wieck 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> In-Reply-To: <468E7AC3.3040501@Yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/170 X-Sequence-Number: 105085 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. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com