Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread dormando
> >Also your instance hasn't even malloc'ed half of its memory limit. You 
> have over 6 gigabytes unused. There aren't any evictions despite the 
> uptime being over two months. 
> Was eviction of active items expeted as well? We have eviction of unsed and 
> unfetched items. 

Your evictions are literally zero, in these stats. You saw them before,
when the instances were smaller?

> >Otherwise: 
> 1. is the default in 1.5 anyway 
> 2. is the default in 1.5. 
> 3. don't bother changing this; it'll change the way the slabs scale. 
> 4. 1.20 is probably fine. reducing it only helps if you have very little 
> memory. 
> 5. also fine. 

> Does increasing slab classes by reducing growth factor affect
> performance? I understand if we have more slab classes it can help in
> increasing storage overhead as less memory as we may find chunk size closer 
> to item size.

There're a maximum of 63 classes, so making the number smaller has a
limited effect. The more slab classes you have, the harder the automove
balancer has to work to keep things even. I don't really recommend
adjusting the value much if at all.

All you probably had to do was turn on automove, but I don't have your
stats from when you did have evictions so I can't say for sure.

> >If it were full and automove was off like it is now, you would see 
> problems over time. Noted.Thank you for the input. :)
>
> Thank you,
> Shweta
>
> On Wednesday, July 8, 2020 at 10:00:30 AM UTC+5:30, Dormando wrote:
>   you said you were seeing evictions? Was this on a different instance?
>
>   I don't really have any control or influence over what amazon deploys 
> for
>   elasticache. They've also changed the daemon. Some of your settings are
>   different from the defaults that 1.5.10 has (automove should default to 
> 1
>   and hash_Algo should default to murmur).
>
>   Also your instance hasn't even malloc'ed half of its memory limit. You
>   have over 6 gigabytes unused. There aren't any evictions despite the
>   uptime being over two months.
>
>   So far as I can see you don't have to do anything? Unless a different
>   instance was giving you trouble.
>
>   Otherwise:
>   1. is the default in 1.5 anyway
>   2. is the default in 1.5.
>   3. don't bother changing this; it'll change the way the slabs scale.
>   4. 1.20 is probably fine. reducing it only helps if you have very little
>   memory.
>   5. also fine.
>
>   but mainly 1) I can't really guarantee anything I say has relevance 
> since
>   I don't know what code is in elasticache and 2) your instance isn't even
>   remotely full so I don't have any recommendations.
>
>   If it were full and automove was off like it is now, you would see
>   problems over time.
>
>   On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>
>   > yes
>   >
>   > On Wednesday, July 8, 2020 at 9:35:19 AM UTC+5:30, Dormando wrote:
>   >       Oh, so this is amazon elasticache?
>   >
>   >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >
>   >       > We use aws for deployment and don't have that information. 
> What particularly looks odd in settings? 
>   >       >
>   >       > On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando 
> wrote:
>   >       >       what're your start arguments? the settings look a 
> little odd. ie; the full
>   >       >       commandline (censoring anything important) that you 
> used to start
>   >       >       memcached
>   >       >
>   >       >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >       >
>   >       >       > Sorry. Here it is.
>   >       >       >
>   >       >       > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, 
> Dormando wrote:
>   >       >       >       'stats settings' file is empty
>   >       >       >
>   >       >       >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >       >       >
>   >       >       >       > Hi Dormando,
>   >       >       >       > Got the stats for production. Please find 
> attached files for stats settings. stats items, stats, stats slabs.
>   Summary for
>   >       all slabs.
>   >       >       >       >
>   >       >       >       > Other details that might help:
>   >       >       >       >  *  TTL is two days or more. 
>   >       >       >       >  *  Key length is in the range of 40-80 bytes.
>   >       >       >       > Below are the parameters that we plan to 
> change from the current settings:
>   >       >       >       >  1. slab_automove : from 0 to 1
>   >       >       >       >  2. hash_algorithm: from jenkins to murmur
>   >       >       >       >  3. chunk_size: from 48 to 297 (as we don't 
> have data of size less than that)
>   >       >       >       >  4. growth_factor: 1.25 to 1.20 ( Can 
> reducing this more help? Do more slab classes affect performance?)
>

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread Shweta Agrawal
>you said you were seeing evictions? Was this on a different instance? 
Yes we had this issue before and therefore we provisioned larger instance 
to fix that temporarily. But now we want to reduce cost by using instance 
with less memory.

>I don't really have any control or influence over what amazon deploys for 
elasticache. They've also changed the daemon. Some of your settings are 
different from the defaults that 1.5.10 has (automove should default to 1 
and hash_Algo should default to murmur). 
I see. Had understanding that it will be same. Thank you for clarifying. 

>Also your instance hasn't even malloc'ed half of its memory limit. You 
have over 6 gigabytes unused. There aren't any evictions despite the 
uptime being over two months. 
Was eviction of active items expeted as well? We have eviction of unsed and 
unfetched items. 

>Otherwise: 
1. is the default in 1.5 anyway 
2. is the default in 1.5. 
3. don't bother changing this; it'll change the way the slabs scale. 
4. 1.20 is probably fine. reducing it only helps if you have very little 
memory. 
5. also fine. 
Does increasing slab classes by reducing growth factor affect performance? 
I understand if we have more slab classes it can help in increasing storage 
overhead as less memory as we may find chunk size closer to item size.

>If it were full and automove was off like it is now, you would see 
problems over time. 
Noted.Thank you for the input. :)

Thank you,
Shweta

On Wednesday, July 8, 2020 at 10:00:30 AM UTC+5:30, Dormando wrote:
>
> you said you were seeing evictions? Was this on a different instance? 
>
> I don't really have any control or influence over what amazon deploys for 
> elasticache. They've also changed the daemon. Some of your settings are 
> different from the defaults that 1.5.10 has (automove should default to 1 
> and hash_Algo should default to murmur). 
>
> Also your instance hasn't even malloc'ed half of its memory limit. You 
> have over 6 gigabytes unused. There aren't any evictions despite the 
> uptime being over two months. 
>
> So far as I can see you don't have to do anything? Unless a different 
> instance was giving you trouble. 
>
> Otherwise: 
> 1. is the default in 1.5 anyway 
> 2. is the default in 1.5. 
> 3. don't bother changing this; it'll change the way the slabs scale. 
> 4. 1.20 is probably fine. reducing it only helps if you have very little 
> memory. 
> 5. also fine. 
>
> but mainly 1) I can't really guarantee anything I say has relevance since 
> I don't know what code is in elasticache and 2) your instance isn't even 
> remotely full so I don't have any recommendations. 
>
> If it were full and automove was off like it is now, you would see 
> problems over time. 
>
> On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
>
> > yes 
> > 
> > On Wednesday, July 8, 2020 at 9:35:19 AM UTC+5:30, Dormando wrote: 
> >   Oh, so this is amazon elasticache? 
> > 
> >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> > 
> >   > We use aws for deployment and don't have that information. What 
> particularly looks odd in settings?  
> >   > 
> >   > On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando 
> wrote: 
> >   >   what're your start arguments? the settings look a little 
> odd. ie; the full 
> >   >   commandline (censoring anything important) that you used 
> to start 
> >   >   memcached 
> >   > 
> >   >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> >   > 
> >   >   > Sorry. Here it is. 
> >   >   > 
> >   >   > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, 
> Dormando wrote: 
> >   >   >   'stats settings' file is empty 
> >   >   > 
> >   >   >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> >   >   > 
> >   >   >   > Hi Dormando, 
> >   >   >   > Got the stats for production. Please find 
> attached files for stats settings. stats items, stats, stats slabs. Summary 
> for 
> >   all slabs. 
> >   >   >   > 
> >   >   >   > Other details that might help: 
> >   >   >   >  *  TTL is two days or more.  
> >   >   >   >  *  Key length is in the range of 40-80 bytes. 
> >   >   >   > Below are the parameters that we plan to change 
> from the current settings: 
> >   >   >   >  1. slab_automove : from 0 to 1 
> >   >   >   >  2. hash_algorithm: from jenkins to murmur 
> >   >   >   >  3. chunk_size: from 48 to 297 (as we don't have 
> data of size less than that) 
> >   >   >   >  4. growth_factor: 1.25 to 1.20 ( Can reducing 
> this more help? Do more slab classes affect performance?) 
> >   >   >   >  5. max_item_size : from 4MB to 1MB (as our data 
> will never be more than 1MB large) 
> >   >   >   > Please let me know if different values for above 
> paramters can be more beneficial. 
> >   >   > 

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread dormando
you said you were seeing evictions? Was this on a different instance?

I don't really have any control or influence over what amazon deploys for
elasticache. They've also changed the daemon. Some of your settings are
different from the defaults that 1.5.10 has (automove should default to 1
and hash_Algo should default to murmur).

Also your instance hasn't even malloc'ed half of its memory limit. You
have over 6 gigabytes unused. There aren't any evictions despite the
uptime being over two months.

So far as I can see you don't have to do anything? Unless a different
instance was giving you trouble.

Otherwise:
1. is the default in 1.5 anyway
2. is the default in 1.5.
3. don't bother changing this; it'll change the way the slabs scale.
4. 1.20 is probably fine. reducing it only helps if you have very little
memory.
5. also fine.

but mainly 1) I can't really guarantee anything I say has relevance since
I don't know what code is in elasticache and 2) your instance isn't even
remotely full so I don't have any recommendations.

If it were full and automove was off like it is now, you would see
problems over time.

On Tue, 7 Jul 2020, Shweta Agrawal wrote:

> yes
>
> On Wednesday, July 8, 2020 at 9:35:19 AM UTC+5:30, Dormando wrote:
>   Oh, so this is amazon elasticache?
>
>   On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>
>   > We use aws for deployment and don't have that information. What 
> particularly looks odd in settings? 
>   >
>   > On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando wrote:
>   >       what're your start arguments? the settings look a little odd. 
> ie; the full
>   >       commandline (censoring anything important) that you used to 
> start
>   >       memcached
>   >
>   >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >
>   >       > Sorry. Here it is.
>   >       >
>   >       > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, Dormando 
> wrote:
>   >       >       'stats settings' file is empty
>   >       >
>   >       >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >       >
>   >       >       > Hi Dormando,
>   >       >       > Got the stats for production. Please find attached 
> files for stats settings. stats items, stats, stats slabs. Summary for
>   all slabs.
>   >       >       >
>   >       >       > Other details that might help:
>   >       >       >  *  TTL is two days or more. 
>   >       >       >  *  Key length is in the range of 40-80 bytes.
>   >       >       > Below are the parameters that we plan to change from 
> the current settings:
>   >       >       >  1. slab_automove : from 0 to 1
>   >       >       >  2. hash_algorithm: from jenkins to murmur
>   >       >       >  3. chunk_size: from 48 to 297 (as we don't have data 
> of size less than that)
>   >       >       >  4. growth_factor: 1.25 to 1.20 ( Can reducing this 
> more help? Do more slab classes affect performance?)
>   >       >       >  5. max_item_size : from 4MB to 1MB (as our data will 
> never be more than 1MB large)
>   >       >       > Please let me know if different values for above 
> paramters can be more beneficial.
>   >       >       > Are there any other parameters which we should 
> consider to change or set?
>   >       >       >
>   >       >       > Also below are the calculations used for columns in 
> the summary shared. Can you please confirm if calculations are fine.
>   >       >       > 1) Total_Mem = total_pages*page_size  --> total 
> memory 
>   >       >       > 2) Strg_ovrHd = 
> (mem_requested/(used_chunks*chunk_size)) * 100 --> storage overhead
>   >       >       > 3) Free Memory = free_chunks * chunk_size   ---> free 
> memory
>   >       >       > 4) To Store = mem_requested      -->   actual memory 
> requested for storing data
>   >       >       >
>   >       >       > Thank you for your time and efforts in explaining 
> concepts.
>   >       >       > Shweta
>   >       >       >
>   >       >       >             > > the rest is free memory, which should 
> be measured separately.
>   >       >       >             > free memory for a class will be : 
> (free_chunks * chunk_size) 
>   >       >       >             > And total memory reserved by a class 
> will be : (total_pages*page_size)
>   >       >       >             >
>   >       >       >             > > If you're getting evictions in class 
> A but there's too much free memory in classes C, D, etc 
>   >       >       >             > > then you have a balance issue. for 
> example. An efficiency stat which just 
>   >       >       >             > > adds up the total pages doesn't tell 
> you what to do with it. 
>   >       >       >             > I see. Got your point.Storage overhead 
> can help in deciding the chunk_size and growth_factor. Let me add
>   >       

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread Shweta Agrawal
yes

On Wednesday, July 8, 2020 at 9:35:19 AM UTC+5:30, Dormando wrote:
>
> Oh, so this is amazon elasticache? 
>
> On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
>
> > We use aws for deployment and don't have that information. What 
> particularly looks odd in settings?  
> > 
> > On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando wrote: 
> >   what're your start arguments? the settings look a little odd. ie; 
> the full 
> >   commandline (censoring anything important) that you used to start 
> >   memcached 
> > 
> >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> > 
> >   > Sorry. Here it is. 
> >   > 
> >   > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, Dormando 
> wrote: 
> >   >   'stats settings' file is empty 
> >   > 
> >   >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> >   > 
> >   >   > Hi Dormando, 
> >   >   > Got the stats for production. Please find attached files 
> for stats settings. stats items, stats, stats slabs. Summary for all slabs. 
> >   >   > 
> >   >   > Other details that might help: 
> >   >   >  *  TTL is two days or more.  
> >   >   >  *  Key length is in the range of 40-80 bytes. 
> >   >   > Below are the parameters that we plan to change from the 
> current settings: 
> >   >   >  1. slab_automove : from 0 to 1 
> >   >   >  2. hash_algorithm: from jenkins to murmur 
> >   >   >  3. chunk_size: from 48 to 297 (as we don't have data of 
> size less than that) 
> >   >   >  4. growth_factor: 1.25 to 1.20 ( Can reducing this more 
> help? Do more slab classes affect performance?) 
> >   >   >  5. max_item_size : from 4MB to 1MB (as our data will 
> never be more than 1MB large) 
> >   >   > Please let me know if different values for above 
> paramters can be more beneficial. 
> >   >   > Are there any other parameters which we should consider 
> to change or set? 
> >   >   > 
> >   >   > Also below are the calculations used for columns in the 
> summary shared. Can you please confirm if calculations are fine. 
> >   >   > 1) Total_Mem = total_pages*page_size  --> total memory  
> >   >   > 2) Strg_ovrHd = (mem_requested/(used_chunks*chunk_size)) 
> * 100 --> storage overhead 
> >   >   > 3) Free Memory = free_chunks * chunk_size   ---> free 
> memory 
> >   >   > 4) To Store = mem_requested  -->   actual memory 
> requested for storing data 
> >   >   > 
> >   >   > Thank you for your time and efforts in explaining 
> concepts. 
> >   >   > Shweta 
> >   >   > 
> >   >   > > > the rest is free memory, which should be 
> measured separately. 
> >   >   > > free memory for a class will be : 
> (free_chunks * chunk_size)  
> >   >   > > And total memory reserved by a class will 
> be : (total_pages*page_size) 
> >   >   > > 
> >   >   > > > If you're getting evictions in class A 
> but there's too much free memory in classes C, D, etc  
> >   >   > > > then you have a balance issue. for 
> example. An efficiency stat which just  
> >   >   > > > adds up the total pages doesn't tell you 
> what to do with it.  
> >   >   > > I see. Got your point.Storage overhead can 
> help in deciding the chunk_size and growth_factor. Let me add 
> >   storage-overhead and 
> >   >   > free memory as well for 
> >   >   > > calculation. 
> >   >   > 
> >   >   > Most people don't have to worry about 
> growth_factor very much. Especially 
> >   >   > since the large item code was added, but it 
> has its own caveats. Growth 
> >   >   > factor is only typically useful if you have 
> _very_ statically sized 
> >   >   > objects. 
> >   >   > 
> >   >   > > One curious question: If we have an item 
> of 500Bytes and there is free memory only in class A(chunk_size: 100Bytes). 
> >   Do cache 
> >   >   > evict items from class with 
> >   >   > > largeer chunk_size or use multiple chunks 
> from class A? 
> >   >   > 
> >   >   > No, it will evict an item matching the 500 
> byte chunk size, and not touch 
> >   >   > A. This is where the memory balancer comes 
> in; it will move pages of 
> >   >   > memory between slab classes to keep the tail 
> age roughly the same between 
> >   >   > classes. It does this slowly. 
> >   >   > 
> >   >   > > Example: 
> >   >   > > In below scenario, when we try to store 
> item with 3MB, even when there was 

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread dormando
Oh, so this is amazon elasticache?

On Tue, 7 Jul 2020, Shweta Agrawal wrote:

> We use aws for deployment and don't have that information. What particularly 
> looks odd in settings? 
>
> On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando wrote:
>   what're your start arguments? the settings look a little odd. ie; the 
> full
>   commandline (censoring anything important) that you used to start
>   memcached
>
>   On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>
>   > Sorry. Here it is.
>   >
>   > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, Dormando wrote:
>   >       'stats settings' file is empty
>   >
>   >       On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>   >
>   >       > Hi Dormando,
>   >       > Got the stats for production. Please find attached files for 
> stats settings. stats items, stats, stats slabs. Summary for all slabs.
>   >       >
>   >       > Other details that might help:
>   >       >  *  TTL is two days or more. 
>   >       >  *  Key length is in the range of 40-80 bytes.
>   >       > Below are the parameters that we plan to change from the 
> current settings:
>   >       >  1. slab_automove : from 0 to 1
>   >       >  2. hash_algorithm: from jenkins to murmur
>   >       >  3. chunk_size: from 48 to 297 (as we don't have data of size 
> less than that)
>   >       >  4. growth_factor: 1.25 to 1.20 ( Can reducing this more 
> help? Do more slab classes affect performance?)
>   >       >  5. max_item_size : from 4MB to 1MB (as our data will never 
> be more than 1MB large)
>   >       > Please let me know if different values for above paramters 
> can be more beneficial.
>   >       > Are there any other parameters which we should consider to 
> change or set?
>   >       >
>   >       > Also below are the calculations used for columns in the 
> summary shared. Can you please confirm if calculations are fine.
>   >       > 1) Total_Mem = total_pages*page_size  --> total memory 
>   >       > 2) Strg_ovrHd = (mem_requested/(used_chunks*chunk_size)) * 
> 100 --> storage overhead
>   >       > 3) Free Memory = free_chunks * chunk_size   ---> free memory
>   >       > 4) To Store = mem_requested      -->   actual memory 
> requested for storing data
>   >       >
>   >       > Thank you for your time and efforts in explaining concepts.
>   >       > Shweta
>   >       >
>   >       >             > > the rest is free memory, which should be 
> measured separately.
>   >       >             > free memory for a class will be : (free_chunks 
> * chunk_size) 
>   >       >             > And total memory reserved by a class will be : 
> (total_pages*page_size)
>   >       >             >
>   >       >             > > If you're getting evictions in class A but 
> there's too much free memory in classes C, D, etc 
>   >       >             > > then you have a balance issue. for example. 
> An efficiency stat which just 
>   >       >             > > adds up the total pages doesn't tell you what 
> to do with it. 
>   >       >             > I see. Got your point.Storage overhead can help 
> in deciding the chunk_size and growth_factor. Let me add
>   storage-overhead and
>   >       >             free memory as well for
>   >       >             > calculation.
>   >       >
>   >       >             Most people don't have to worry about 
> growth_factor very much. Especially
>   >       >             since the large item code was added, but it has 
> its own caveats. Growth
>   >       >             factor is only typically useful if you have 
> _very_ statically sized
>   >       >             objects.
>   >       >
>   >       >             > One curious question: If we have an item of 
> 500Bytes and there is free memory only in class A(chunk_size: 100Bytes).
>   Do cache
>   >       >             evict items from class with
>   >       >             > largeer chunk_size or use multiple chunks from 
> class A?
>   >       >
>   >       >             No, it will evict an item matching the 500 byte 
> chunk size, and not touch
>   >       >             A. This is where the memory balancer comes in; it 
> will move pages of
>   >       >             memory between slab classes to keep the tail age 
> roughly the same between
>   >       >             classes. It does this slowly.
>   >       >
>   >       >             > Example:
>   >       >             > In below scenario, when we try to store item 
> with 3MB, even when there was memory in class with smaller chunk_size, it
>   evicts
>   >       >             items from 512K class and
>   >       >             > other memory is blocked by smaller slabs.
>   >       >
>   >       >             Large (> 512KB) items are an exception. It will 
> try to 

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread Shweta Agrawal
We use aws for deployment and don't have that information. What 
particularly looks odd in settings? 

On Wednesday, July 8, 2020 at 8:10:04 AM UTC+5:30, Dormando wrote:
>
> what're your start arguments? the settings look a little odd. ie; the full 
> commandline (censoring anything important) that you used to start 
> memcached 
>
> On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
>
> > Sorry. Here it is. 
> > 
> > On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, Dormando wrote: 
> >   'stats settings' file is empty 
> > 
> >   On Tue, 7 Jul 2020, Shweta Agrawal wrote: 
> > 
> >   > Hi Dormando, 
> >   > Got the stats for production. Please find attached files for 
> stats settings. stats items, stats, stats slabs. Summary for all slabs. 
> >   > 
> >   > Other details that might help: 
> >   >  *  TTL is two days or more.  
> >   >  *  Key length is in the range of 40-80 bytes. 
> >   > Below are the parameters that we plan to change from the current 
> settings: 
> >   >  1. slab_automove : from 0 to 1 
> >   >  2. hash_algorithm: from jenkins to murmur 
> >   >  3. chunk_size: from 48 to 297 (as we don't have data of size 
> less than that) 
> >   >  4. growth_factor: 1.25 to 1.20 ( Can reducing this more help? 
> Do more slab classes affect performance?) 
> >   >  5. max_item_size : from 4MB to 1MB (as our data will never be 
> more than 1MB large) 
> >   > Please let me know if different values for above paramters can 
> be more beneficial. 
> >   > Are there any other parameters which we should consider to 
> change or set? 
> >   > 
> >   > Also below are the calculations used for columns in the summary 
> shared. Can you please confirm if calculations are fine. 
> >   > 1) Total_Mem = total_pages*page_size  --> total memory  
> >   > 2) Strg_ovrHd = (mem_requested/(used_chunks*chunk_size)) * 100 
> --> storage overhead 
> >   > 3) Free Memory = free_chunks * chunk_size   ---> free memory 
> >   > 4) To Store = mem_requested  -->   actual memory requested 
> for storing data 
> >   > 
> >   > Thank you for your time and efforts in explaining concepts. 
> >   > Shweta 
> >   > 
> >   > > > the rest is free memory, which should be 
> measured separately. 
> >   > > free memory for a class will be : (free_chunks * 
> chunk_size)  
> >   > > And total memory reserved by a class will be : 
> (total_pages*page_size) 
> >   > > 
> >   > > > If you're getting evictions in class A but 
> there's too much free memory in classes C, D, etc  
> >   > > > then you have a balance issue. for example. An 
> efficiency stat which just  
> >   > > > adds up the total pages doesn't tell you what to 
> do with it.  
> >   > > I see. Got your point.Storage overhead can help in 
> deciding the chunk_size and growth_factor. Let me add storage-overhead and 
> >   > free memory as well for 
> >   > > calculation. 
> >   > 
> >   > Most people don't have to worry about growth_factor 
> very much. Especially 
> >   > since the large item code was added, but it has its 
> own caveats. Growth 
> >   > factor is only typically useful if you have _very_ 
> statically sized 
> >   > objects. 
> >   > 
> >   > > One curious question: If we have an item of 
> 500Bytes and there is free memory only in class A(chunk_size: 100Bytes). Do 
> cache 
> >   > evict items from class with 
> >   > > largeer chunk_size or use multiple chunks from 
> class A? 
> >   > 
> >   > No, it will evict an item matching the 500 byte 
> chunk size, and not touch 
> >   > A. This is where the memory balancer comes in; it 
> will move pages of 
> >   > memory between slab classes to keep the tail age 
> roughly the same between 
> >   > classes. It does this slowly. 
> >   > 
> >   > > Example: 
> >   > > In below scenario, when we try to store item with 
> 3MB, even when there was memory in class with smaller chunk_size, it evicts 
> >   > items from 512K class and 
> >   > > other memory is blocked by smaller slabs. 
> >   > 
> >   > Large (> 512KB) items are an exception. It will try 
> to evict from the 
> >   > "large item" bucket, which is 512kb. It will try to 
> do this up to a few 
> >   > times, trying to free up enough memory to make space 
> for the large item. 
> >   > 
> >   > So to make space for a 3MB item, if the tail item is 
> 5MB in size or 1MB in 
> >   > size, they will still be evicted. If the tail age is 
> low compared to all 
> >

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread dormando
what're your start arguments? the settings look a little odd. ie; the full
commandline (censoring anything important) that you used to start
memcached

On Tue, 7 Jul 2020, Shweta Agrawal wrote:

> Sorry. Here it is.
>
> On Wednesday, July 8, 2020 at 12:38:38 AM UTC+5:30, Dormando wrote:
>   'stats settings' file is empty
>
>   On Tue, 7 Jul 2020, Shweta Agrawal wrote:
>
>   > Hi Dormando,
>   > Got the stats for production. Please find attached files for stats 
> settings. stats items, stats, stats slabs. Summary for all slabs.
>   >
>   > Other details that might help:
>   >  *  TTL is two days or more. 
>   >  *  Key length is in the range of 40-80 bytes.
>   > Below are the parameters that we plan to change from the current 
> settings:
>   >  1. slab_automove : from 0 to 1
>   >  2. hash_algorithm: from jenkins to murmur
>   >  3. chunk_size: from 48 to 297 (as we don't have data of size less 
> than that)
>   >  4. growth_factor: 1.25 to 1.20 ( Can reducing this more help? Do 
> more slab classes affect performance?)
>   >  5. max_item_size : from 4MB to 1MB (as our data will never be more 
> than 1MB large)
>   > Please let me know if different values for above paramters can be 
> more beneficial.
>   > Are there any other parameters which we should consider to change or 
> set?
>   >
>   > Also below are the calculations used for columns in the summary 
> shared. Can you please confirm if calculations are fine.
>   > 1) Total_Mem = total_pages*page_size  --> total memory 
>   > 2) Strg_ovrHd = (mem_requested/(used_chunks*chunk_size)) * 100 --> 
> storage overhead
>   > 3) Free Memory = free_chunks * chunk_size   ---> free memory
>   > 4) To Store = mem_requested      -->   actual memory requested for 
> storing data
>   >
>   > Thank you for your time and efforts in explaining concepts.
>   > Shweta
>   >
>   >             > > the rest is free memory, which should be measured 
> separately.
>   >             > free memory for a class will be : (free_chunks * 
> chunk_size) 
>   >             > And total memory reserved by a class will be : 
> (total_pages*page_size)
>   >             >
>   >             > > If you're getting evictions in class A but there's 
> too much free memory in classes C, D, etc 
>   >             > > then you have a balance issue. for example. An 
> efficiency stat which just 
>   >             > > adds up the total pages doesn't tell you what to do 
> with it. 
>   >             > I see. Got your point.Storage overhead can help in 
> deciding the chunk_size and growth_factor. Let me add storage-overhead and
>   >             free memory as well for
>   >             > calculation.
>   >
>   >             Most people don't have to worry about growth_factor very 
> much. Especially
>   >             since the large item code was added, but it has its own 
> caveats. Growth
>   >             factor is only typically useful if you have _very_ 
> statically sized
>   >             objects.
>   >
>   >             > One curious question: If we have an item of 500Bytes 
> and there is free memory only in class A(chunk_size: 100Bytes). Do cache
>   >             evict items from class with
>   >             > largeer chunk_size or use multiple chunks from class A?
>   >
>   >             No, it will evict an item matching the 500 byte chunk 
> size, and not touch
>   >             A. This is where the memory balancer comes in; it will 
> move pages of
>   >             memory between slab classes to keep the tail age roughly 
> the same between
>   >             classes. It does this slowly.
>   >
>   >             > Example:
>   >             > In below scenario, when we try to store item with 3MB, 
> even when there was memory in class with smaller chunk_size, it evicts
>   >             items from 512K class and
>   >             > other memory is blocked by smaller slabs.
>   >
>   >             Large (> 512KB) items are an exception. It will try to 
> evict from the
>   >             "large item" bucket, which is 512kb. It will try to do 
> this up to a few
>   >             times, trying to free up enough memory to make space for 
> the large item.
>   >
>   >             So to make space for a 3MB item, if the tail item is 5MB 
> in size or 1MB in
>   >             size, they will still be evicted. If the tail age is low 
> compared to all
>   >             other classes, the memory balancer will eventually move 
> more pages into
>   >             the 512K slab class.
>   >
>   >             If you tend to store a lot of very large items, it works 
> better if the
>   >             instances are larger.
>   >
>   >             Memcached is more optimized for performance with small 
> items. if you try
> 

Re: Total memory allocated with -m NOT EQUAL to (total pages * max_item_size). Request to provide clarification on how page size works.

2020-07-07 Thread dormando
'stats settings' file is empty

On Tue, 7 Jul 2020, Shweta Agrawal wrote:

> Hi Dormando,
> Got the stats for production. Please find attached files for stats settings. 
> stats items, stats, stats slabs. Summary for all slabs.
>
> Other details that might help:
>  *  TTL is two days or more. 
>  *  Key length is in the range of 40-80 bytes.
> Below are the parameters that we plan to change from the current settings:
>  1. slab_automove : from 0 to 1
>  2. hash_algorithm: from jenkins to murmur
>  3. chunk_size: from 48 to 297 (as we don't have data of size less than that)
>  4. growth_factor: 1.25 to 1.20 ( Can reducing this more help? Do more slab 
> classes affect performance?)
>  5. max_item_size : from 4MB to 1MB (as our data will never be more than 1MB 
> large)
> Please let me know if different values for above paramters can be more 
> beneficial.
> Are there any other parameters which we should consider to change or set?
>
> Also below are the calculations used for columns in the summary shared. Can 
> you please confirm if calculations are fine.
> 1) Total_Mem = total_pages*page_size  --> total memory 
> 2) Strg_ovrHd = (mem_requested/(used_chunks*chunk_size)) * 100 --> storage 
> overhead
> 3) Free Memory = free_chunks * chunk_size   ---> free memory
> 4) To Store = mem_requested      -->   actual memory requested for storing 
> data
>
> Thank you for your time and efforts in explaining concepts.
> Shweta
>
> > > the rest is free memory, which should be measured separately.
> > free memory for a class will be : (free_chunks * chunk_size) 
> > And total memory reserved by a class will be : 
> (total_pages*page_size)
> >
> > > If you're getting evictions in class A but there's too much 
> free memory in classes C, D, etc 
> > > then you have a balance issue. for example. An efficiency 
> stat which just 
> > > adds up the total pages doesn't tell you what to do with it. 
> > I see. Got your point.Storage overhead can help in deciding the 
> chunk_size and growth_factor. Let me add storage-overhead and
> free memory as well for
> > calculation.
>
> Most people don't have to worry about growth_factor very much. 
> Especially
> since the large item code was added, but it has its own caveats. 
> Growth
> factor is only typically useful if you have _very_ statically 
> sized
> objects.
>
> > One curious question: If we have an item of 500Bytes and there 
> is free memory only in class A(chunk_size: 100Bytes). Do cache
> evict items from class with
> > largeer chunk_size or use multiple chunks from class A?
>
> No, it will evict an item matching the 500 byte chunk size, and 
> not touch
> A. This is where the memory balancer comes in; it will move pages 
> of
> memory between slab classes to keep the tail age roughly the same 
> between
> classes. It does this slowly.
>
> > Example:
> > In below scenario, when we try to store item with 3MB, even 
> when there was memory in class with smaller chunk_size, it evicts
> items from 512K class and
> > other memory is blocked by smaller slabs.
>
> Large (> 512KB) items are an exception. It will try to evict from 
> the
> "large item" bucket, which is 512kb. It will try to do this up to 
> a few
> times, trying to free up enough memory to make space for the 
> large item.
>
> So to make space for a 3MB item, if the tail item is 5MB in size 
> or 1MB in
> size, they will still be evicted. If the tail age is low compared 
> to all
> other classes, the memory balancer will eventually move more 
> pages into
> the 512K slab class.
>
> If you tend to store a lot of very large items, it works better 
> if the
> instances are larger.
>
> Memcached is more optimized for performance with small items. if 
> you try
> to store a small item, it will evict exactly one item to make 
> space.
> However, for very large items (1MB+), the time it takes to read 
> the data
> from the network is so large that we can afford to do extra 
> processing.
>
> > 3Mb_items_eviction.png
> >
> >
> > Thank you,
> > Shweta
> >
> >
> > On Sunday, July 5, 2020 at 1:13:19 AM UTC+5:30, Dormando wrote:
> >       (memory_requested / (chunk_size * chunk_used)) * 100
> >
> >       is roughly the storage overhead of memory used in the 
> system. the rest is
> >       free memory, which should be measured separately. If 
> you're getting
> >       evictions in class A but there's too much free memory in