RE: Protect syscache from bloating with negative cache entries

Поиск
Список
Период
Сортировка
От Ideriha, Takeshi
Тема RE: Protect syscache from bloating with negative cache entries
Дата
Msg-id 4E72940DA2BF16479384A86D54D0988A6F3D0D5F@G01JPEXMBKW04
обсуждение исходный текст
Ответ на RE: Protect syscache from bloating with negative cache entries  ("Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>)
Ответы Re: Protect syscache from bloating with negative cache entries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
>From: Ideriha, Takeshi [mailto:ideriha.takeshi@jp.fujitsu.com]
>The detailed comments for the source code will be provided later.

Hi, 
I'm adding some comments to 0001 and 0002 one.

[0001 patch]

+                       /*
                                                   
 
+                        * Calculate the duration from the time of the last access to the
                                                   
 
+                        * "current" time. Since catcacheclock is not advanced within a
                                                   
 
+                        * transaction, the entries that are accessed within the current
                                                   
 
+                        * transaction won't be pruned.
                                                   
 
+                        */
                                                   
 
+                       TimestampDifference(ct->lastaccess, catcacheclock, &entry_age, &us); 


+                       /*                                                                                        
+                        * Try to remove entries older than cache_prune_min_age seconds.                          

+                       if (entry_age > cache_prune_min_age) 


Can you change this comparison between entry_age and cache_prune_min_age 
to "entry_age >= cache_prune_min_age"?
That is, I want the feature that entries that are accessed even within the transaction 
is pruned in case of cache_prune_min_age = 0 
I can hit upon some of my customer who want to always keep memory usage below certain limit as strictly as possible.
This kind of strict user would set cache_prune_min_age to 0 and would not want to exceed the memory target even
if within a transaction.

As I put miscellaneous comments about 0001 patch in some previous email, so please take a look at it.

[0002 patch]
I haven't looked into every detail but here are some comments.

Maybe you would also need to add some sentences to this page:
https://www.postgresql.org/docs/current/monitoring-stats.html

+pgstat_get_syscache_stats(PG_FUNCTION_ARGS) 
Function name like 'pg_stat_XXX' would match surrounding code. 

When applying patch I found trailing whitespace warning:
../patch/horiguchi_cache/v6_stats/0002-Syscache-usage-tracking-feature.patch:157: trailing whitespace.

../patch/horiguchi_cache/v6_stats/0002-Syscache-usage-tracking-feature.patch:256: trailing whitespace.

../patch/horiguchi_cache/v6_stats/0002-Syscache-usage-tracking-feature.patch:301: trailing whitespace.

../patch/horiguchi_cache/v6_stats/0002-Syscache-usage-tracking-feature.patch:483: trailing whitespace.

../patch/horiguchi_cache/v6_stats/0002-Syscache-usage-tracking-feature.patch:539: trailing whitespace.
    

Regards,
Takeshi Ideriha



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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [HACKERS] Restricting maximum keep segments by repslots
Следующее
От: David Rowley
Дата:
Сообщение: Re: Using POPCNT and other advanced bit manipulation instructions