[pgpool-general: 8262] Re: Shared memory cache size formula

Tatsuo Ishii ishii at sraoss.co.jp
Mon Jun 27 14:59:48 JST 2022


> But in case I have very large result that I want to store in the cache how
> I should calculate the cache total size?

The size for per cache entry is default to 400kB. Are you sure that
your result is lager than 400kB?  If so, you can increase
memqcache_maxcache up to say, 8191kB, which is slightly smaller than
memqcache_cache_block_size.

If it's not enough, you should increase memqcache_cache_block_size
too.

> On Mon, 27 Jun 2022 at 8:27 Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
>> > Do you know what is the best formula to calculate the cache size when
>> using
>> > shared memory, in case I want a greater query result size.
>> >
>> > How do I address to the block size and the number of cache entries?
>>
>> Unless your queries return very large results, usually you don't need
>> to adjust the cache block size.
>>
>> For the number of cache entries (num_hash_entries), you should consult
>> "show pool_cache" command. Here are some advices:
>>
>> - If cache_hit_ration is good enough (for example over 0.9), then you
>>   do not need to adjst num_hash_entries.
>>
>> - If cache_hit_ration is not good, try to increase num_hash_entries so
>>   that pgpool can hold more cache entries. However, it is possible
>>   that the cache hit ratio won't be better because your system is
>>   write heavy. In this case you should think more if you really want
>>   to use the cache system.
>>
>> Good luck!
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese:http://www.sraoss.co.jp
>>


More information about the pgpool-general mailing list