Re: PATCH: pgbench - merging transaction logs

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: PATCH: pgbench - merging transaction logs
Дата
Msg-id alpine.DEB.2.10.1503212036400.14445@sto
обсуждение исходный текст
Ответ на Re: PATCH: pgbench - merging transaction logs  (didier <did447@gmail.com>)
Ответы Re: PATCH: pgbench - merging transaction logs  (didier <did447@gmail.com>)
Список pgsql-hackers
Hello Didier,

>> If fprintf takes p = 0.025 (1/40) of the time, then with 2 threads the
>> collision probability would be about 1/40 and the delayed thread would be
>> waiting for half this time on average, so the performance impact due to
>> fprintf locking would be negligeable (1/80 delay occured in 1/40 cases =>
>> 1/3200 time added on the computed average, if I'm not mistaken).

> If  threads run more or less the same code with the same timing after
> a while they will lockstep  on synchronization primitives and your
> collision probability will be very close to 1.

I'm not sure I understand. If transaction times were really constant, then 
after a while the mutexes would be synchronised so as to avoid contention, 
i.e. the collision probability would be 0?

> Moreover  they will write to the same cache lines for every fprintf
> and this is very very bad even without atomic operations.

We're talking of transactions that involve network messages and possibly 
disk IOs on the server, so some cache issues issues within pgbench would 
not be a priori the main performance driver.

-- 
Fabien.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: PATCH: pgbench - merging transaction logs
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?