agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PROPOSAL] Shared Ispell dictionaries
Date: Fri, 1 Feb 2019 12:09:28 +0300
Message-ID: <b186f371-a315-487e-4ecf-a88794b7e85e@postgrespro.ru> (raw)
In-Reply-To: <1932084f-167a-8893-be24-c4c06afe113b@2ndquadrant.com>
References: <27296.1522078068@sss.pgh.pa.us>
<20180327121954.GA12726@zakirov.localdomain>
<CA+TgmoaR_fVd_u60mA-PHO=J1u0PmdVGOt9WaxZ1UYuGq276oQ@mail.gmail.com>
<20180516113631.GA29544@zakirov.localdomain>
<20180614084015.GA12451@zakirov.localdomain>
<20181001092204.GA5071@zakirov.localdomain>
<68aaaff6-0efe-c14b-7aee-fb110bb97f69@2ndquadrant.com>
<337f7a55-58b8-4fcc-a933-5e7799fa6882@postgrespro.ru>
<e0a25563-cbb1-7089-8c25-44668cfb031b@postgrespro.ru>
<42b1ded6-fd44-5975-77e4-72ada1f134a2@2ndquadrant.com>
<20190120222121.ehistvcr4wsu2su5@alap3.anarazel.de>
<95aea959-97a1-2ded-c881-eede4e5a1f0c@2ndquadrant.com>
<cad38cdb-2bb1-da75-235f-2e6684826f10@postgrespro.ru>
<b9e470f7-01b5-bf8c-78fc-5633ebc6fa2e@2ndquadrant.com>
<5113daa6-b6e7-59f6-c4a8-96b5b81474fb@postgrespro.ru>
<CAKNkYnyPxoByX0W7fUy=2NPvn880+DW3YZ5tBrFiV4cOaBX1xQ@mail.gmail.com>
<1932084f-167a-8893-be24-c4c06afe113b@2ndquadrant.com>
On 22.01.2019 22:17, Tomas Vondra wrote:
> On 1/22/19 7:36 PM, Arthur Zakirov wrote:
>> max_shared_dictionaries_size can be renamed to
>> shared_dictionaries_cleanup_threshold.
>
> That really depends on what exactly the threshold does. If it only
> triggers cleanup but does not enforce maximum amount of memory used by
> dictionaries, then this name seems OK. If it ensures max amount of
> memory, the max_..._size name would be better.
Yep, I thought about the first approach.
> I think there are essentially two ways:
>
> (a) Define max amount of memory available for shared dictionarires, and
> come up with an eviction algorithm. This will be tricky, because when
> the frequently-used dictionaries need a bit more memory than the limit,
> this will result in trashing (evict+load over and over).
>
> (b) Define what "unused" means for dictionaries, and unload dictionaries
> that become unused. For example, we could track timestamp of the last
> time each dict was used, and decide that dictionaries unused for 5 or
> more minutes are unused. And evict those.
>
> The advantage of (b) is that it adopts automatically, more or less. When
> you have a bunch of frequently used dictionaries, the amount of shared
> memory increases. If you stop using them, it decreases after a while.
> And rarely used dicts won't force eviction of the frequently used ones.
Thanks for sharing your ideas, Tomas. Unfortunately I won't manage to
develop new version of the patch till the end of the commitfest due to
lack of time. I'll think about the second approach. Tracking timestamp
of the last time a dict was used may be difficult though and may slow
down FTS...
I move the path to the next commitfest.
--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
view thread (108+ messages) latest in thread
Message-ID: <b186f371-a315-487e-4ecf-a88794b7e85e@postgrespro.ru>
Permalink: ../b186f371-a315-487e-4ecf-a88794b7e85e@postgrespro.ru/
Also on: postgresql.org/message-id/b186f371-a315-487e-4ecf-a88794b7e85e@postgrespro.ru
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: a.zakirov@postgrespro.ru, tomas.vondra@2ndquadrant.com, andres@anarazel.de, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pavel.stehule@gmail.com
Subject: Re: [PROPOSAL] Shared Ispell dictionaries
In-Reply-To: <b186f371-a315-487e-4ecf-a88794b7e85e@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox