It appears that the memcache interface for IronCache becomes unstable after only a few minutes of inactivity. Making frequent requests within seconds seems to work just fine, and is fast (less than 50ms). But wait a minute or two, try again, and the connection disconnects and must be reestablished. This takes about 2 seconds to complete. This happens repeatedly.
I am using Java with spymemcached 2.8.7. I tested on multiple machines via multiple networks. The only custom setting used on spymemcached is to force the protocol to text.
Hi @mrcritical , the reason for this is that the load balancer we are using has a 60 second timeout. Can you try to perform an operation at least once per minute? Some random "get" or something?
Wow. That seems crazy. It would add up to around 43k+ junk requests per month. But, if that is what is required to keep a fast connection, so be it. I will try it and report back.
By the way the best request time during my testing is 40ms (memcache) vs 400ms (http). It is a pretty big difference. So thanks for making the memcache protocol available.
Ya, it can be wasteful if you're not using it very often. And just to note, the http endpoints can be quite fast after the initial request if you keep the http connection open. If you time the requests after the the first one, they should be in the 10's of ms too (as tested with our Ruby driver).
Using keep-alive I was able to see a low of 47ms. It has a greater variance then the memcached interface. But it certainly can get as low. I will look into building a client for Java and then test it compared to memcached. I'm not very fond of sending junk requests.
Thanks for the quick responses.
I finished the client. My initial tests look good. I do see the 60 second timeout, but the API call only takes between 200ms to 800ms instead of the over 2 seconds consistently when using memcached. So this is a definite improvement, without sending junk requests.
The average request time using the HTTP API with keep-alive is 49ms. This is from AWS to my local (Florida). So I expect better times once I launch, especially since it will be deployed to AWS US-east as well. I will move ahead using the HTTP interface instead of the memcached version.
Thanks for your help.
Thanks for the update @mrcritical, great to hear. Please keep us posted as you move into production.
@mrcritical good to hear. Feel free to open source your client. ;) And you should see times closer to 10ms when on ec2.
Here is the start of the client, https://github.com/mrcritical/ironcache. I still have to add many more test cases, but it works as is.