Обсуждение: Feature request: fsync and commit_delay options per database

Поиск
Список
Период
Сортировка

Feature request: fsync and commit_delay options per database

От
Bráulio Bhavamitra
Дата:
Hello all,

After reading http://stackoverflow.com/questions/9407442/optimise-postgresql-for-fast-testing
I've tried to use commit_delay to make commits really slow on a test
environment. Unfortunetely, the maximum value is 100ms (100_000
microseconds).

Besides increasing it, it would be great to have these two options
(fsync and commit_delay) per database, that is, valid only for
databases configured with them. That would greatly speed up test
running and still make the cluster available for other "real"
databases.

Is this feature or something similar planned?

cheers,
bráulio

--
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão
http://cirandas.net/brauliobo
http://eita.org.br

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
propriedade deste universo é de Brahma, e não dos microcosmos que
também foram criados pela imaginação de Brahma. Nenhuma propriedade
deste mundo, mutável ou imutável, pertence a um indivíduo em
particular; tudo é o patrimônio comum de todos."
Restante do texto em
http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia


Re: Feature request: fsync and commit_delay options per database

От
Tom Lane
Дата:
=?UTF-8?Q?Br=C3=A1ulio_Bhavamitra?= <brauliobo@gmail.com> writes:
> Besides increasing it, it would be great to have these two options
> (fsync and commit_delay) per database, that is, valid only for
> databases configured with them. That would greatly speed up test
> running and still make the cluster available for other "real"
> databases.

> Is this feature or something similar planned?

No.  Neither of them make any sense per-database.

            regards, tom lane


Re: Feature request: fsync and commit_delay options per database

От
Bráulio Bhavamitra
Дата:
On Mon, Jun 29, 2015 at 7:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> =?UTF-8?Q?Br=C3=A1ulio_Bhavamitra?= <brauliobo@gmail.com> writes:
>> Besides increasing it, it would be great to have these two options
>> (fsync and commit_delay) per database, that is, valid only for
>> databases configured with them. That would greatly speed up test
>> running and still make the cluster available for other "real"
>> databases.
>
>> Is this feature or something similar planned?
>
> No.  Neither of them make any sense per-database.
Is there something else planned for in-memory databases?

>
>                         regards, tom lane



--
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão
http://cirandas.net/brauliobo
http://eita.org.br

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
propriedade deste universo é de Brahma, e não dos microcosmos que
também foram criados pela imaginação de Brahma. Nenhuma propriedade
deste mundo, mutável ou imutável, pertence a um indivíduo em
particular; tudo é o patrimônio comum de todos."
Restante do texto em
http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia


Re: Feature request: fsync and commit_delay options per database

От
Jeff Janes
Дата:
2015-06-29 15:18 GMT-07:00 Bráulio Bhavamitra <brauliobo@gmail.com>:
Hello all,

After reading http://stackoverflow.com/questions/9407442/optimise-postgresql-for-fast-testing
I've tried to use commit_delay to make commits really slow on a test
environment. Unfortunetely, the maximum value is 100ms (100_000
microseconds).

Besides increasing it, it would be great to have these two options
(fsync and commit_delay) per database, that is, valid only for
databases configured with them. That would greatly speed up test
running and still make the cluster available for other "real"
databases.

Is this feature or something similar planned?

fsync is inherently across the cluster, so that can't be set per database.  You can configure a different commit_delay in each database on the cluster using "alter database jjanes set commit_delay to 1000;" for example, but if different databases have different settings they will interact with each other in complex, unintuitive ways.  And it is not really clear what you are trying to accomplish by doing this.

Running multiple clusters on the same server is pretty easy to do, as long your client allows you configure which port number it connects to.  If you really want fsync on for one database and off for another one, but each database in a different cluster.

Cheers,

Jeff

Re: Feature request: fsync and commit_delay options per database

От
Bráulio Bhavamitra
Дата:
On Tue, Jun 30, 2015 at 3:43 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> 2015-06-29 15:18 GMT-07:00 Bráulio Bhavamitra <brauliobo@gmail.com>:
>>
>> Hello all,
>>
>> After reading
>> http://stackoverflow.com/questions/9407442/optimise-postgresql-for-fast-testing
>> I've tried to use commit_delay to make commits really slow on a test
>> environment. Unfortunetely, the maximum value is 100ms (100_000
>> microseconds).
>>
>> Besides increasing it, it would be great to have these two options
>> (fsync and commit_delay) per database, that is, valid only for
>> databases configured with them. That would greatly speed up test
>> running and still make the cluster available for other "real"
>> databases.
>>
>> Is this feature or something similar planned?
>
>
> fsync is inherently across the cluster, so that can't be set per database.
> You can configure a different commit_delay in each database on the cluster
> using "alter database jjanes set commit_delay to 1000;" for example, but if
> different databases have different settings they will interact with each
> other in complex, unintuitive ways.  And it is not really clear what you are
> trying to accomplish by doing this.
Great! But for commit_delay to be an usable parameter for in-memory
test databases, it should allow for much higher delays. I would be
happy with 10 minutes, for instance. Is there a reason for a
limitation of 100ms?

>
> Running multiple clusters on the same server is pretty easy to do, as long
> your client allows you configure which port number it connects to.  If you
> really want fsync on for one database and off for another one, but each
> database in a different cluster.
Nice, will try that too, but would prefer the commit_delay setup above.

>
> Cheers,
>
> Jeff



--
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão
http://cirandas.net/brauliobo
http://eita.org.br

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
propriedade deste universo é de Brahma, e não dos microcosmos que
também foram criados pela imaginação de Brahma. Nenhuma propriedade
deste mundo, mutável ou imutável, pertence a um indivíduo em
particular; tudo é o patrimônio comum de todos."
Restante do texto em
http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia