Re: [memcached-session-manager] Production setup values for memcache with msm

66 views
Skip to first unread message

Martin Grotzke

unread,
Aug 13, 2017, 7:52:33 AM8/13/17
to memcached-session-manager

Hi,

sorry for the delay! Are your questions still relevant?

Cheers,
Martin


rdp <rohit...@gmail.com> schrieb am So., 9. Juli 2017, 12:04:
Hi Martin

First of all thank you for msm .It make thing so easy.

I have been working on msm for last two weeks.

I got it working for sticky and non sticky for 2 tomcats with 2 memcache nodes

I need to implement session replication for 6 tomcat servers in production

I would like to know how the configuration values for production memcache nodes should be evaluated


1) -m config value

   - As I understand this will be amount of memory allocate to memcache node to hold session. When this is full LRU session will be removed and will be unavailable.
   - Lets say if one tomcat server has 200 session during peak traffic and average session size in 2kb
   - Are below calculations correct to decide value to "-m" parameter for a memcache node

     (number of tomcats) X (number of session during peak) X (average session size) 

      6 X 200 X 2kb = 24 MB 

      to be safe i will make this double which is 48 MB

     Is there any rule tht you follow for assigning "-m" value


2) How many memcache nodes will be ideal for 6 tomcats. Is there any rule I can follow to decide number of memcache node ?

    Is there any rule tht you follow for assigning for deciding number of memcache nodes?

3) Number of connection allowed per memcached nodes ? How can i determine this ? Is it safe to just make it 
 
        number of tomcat X number of session during peak traffic 

        6 X 200 = 1200  and to be safe I will double this so 2400

    So 2400 connections per memcache node

4) Will sticky option give better performance compared to non sticky ? 
   Is the reason for stickys better performance that ,as we avoid hitting memcache in sticky option and use session from local tomcat and only hit  memcached tomcat is down 


Regards,


 

--

---
You received this message because you are subscribed to the Google Groups "memcached-session-manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rdp

unread,
Aug 20, 2017, 2:28:37 PM8/20/17
to memcached-session-manager

Hi Martin,

Thnx.I posted same question on memcached group. Got a response.

Below is link in case anyone else needs it.

https://groups.google.com/forum/#!topic/memcached/hy4mHWt2Zi8


I have one more question

1. I have a sticky setup with 2 tomcats and 2 memcached nodes.

    tomcat1 with failover node as n2  (My session will be saved on n1 in this case )
  
    tomcat2 with failover node as n1  (My session will be saved on n2 in this case )

2. User starts a session on tomcat1 ,session is backed up on n1.

3. tomcat1 and n1 crashes

 From my test looks like session will be lost after this and there is no way to recover it .

 I understand that this is worst case scenario , is there anyway to avoid it or recover session

Regards,
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-manager+unsub...@googlegroups.com.

Martin Grotzke

unread,
Aug 20, 2017, 5:46:44 PM8/20/17
to memcached-session-manager

Hi,

assuming you have tomcat1 and memcached1 (n1) running on host1, and tomcat2 and memcached2 (n2) on host2, then you should set n1 as failover node for tomcat1, so that tomcat1 does only store sessions in memcached1 if memcached2 is not available.

Does this help?

Cheers,
Martin


To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "memcached-session-manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.

rohit phuge

unread,
Aug 21, 2017, 2:26:45 AM8/21/17
to memcached-se...@googlegroups.com
Hi Martin

Thanks for quick response.

Each tomcat and each memcache node will be on independent host.

In such a sticky setup if my tomcat that generated session and memcache node on which session is stored both crash then I am unable to recover the session and user is getting kicked out.

I understand that this is highly unlikely that both tomcat which generated session and memcache node which stored the session crash.

But ,am I correct in saying that in this scenario failover is not possible

Regards



To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-manager+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "memcached-session-manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-manager+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "memcached-session-manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/memcached-session-manager/Uhn2AkDYtnc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to memcached-session-manager+unsub...@googlegroups.com.

Martin Grotzke

unread,
Aug 22, 2017, 7:37:30 PM8/22/17
to memcached-se...@googlegroups.com

Yes, this is correct.

To handle such a case we'd have to add a configurable "replicationFactor"... But this would have to be a contribution since I don't see that I'll have time to implement this.

Btw, in this setup you don't need to set failoverNodes at all.

Cheers,
Martin


To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "memcached-session-manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to a topic in the Google Groups "memcached-session-manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/memcached-session-manager/Uhn2AkDYtnc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to memcached-session-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "memcached-session-manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memcached-session-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages