Re: usleep feature for pgbench

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: usleep feature for pgbench
Date: 2007-07-06 18:35:29
Message-ID: 468E8B71.90602@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)Yahoo(dot)com #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2007-07-06 18:57:14 Re: Bgwriter strategies
Previous Message Heikki Linnakangas 2007-07-06 18:08:18 Re: Bgwriter strategies