User tests: Successful: Unsuccessful:
AWS AutoDiscovery
AWS Elasticache Memcached support allows auto-discovery to dynamically manage memcached nodes in the cluster. Amazon ElastiCache Cluster Client is an enhanced PHP library to connect to ElastiCache clusters. This client library has been built upon libmemcached and is released under the Apache License. https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php/releases
Current Joomla release as of today (3.6.5) does not support AWS's autodiscovery of nodes and design is based on configuring static nodes in a multi memcached cluster. As of today, the static feature is not fully implemented and will require you to update your configuration if new nodes or failures occur in your cluster. This is a new feature request to support PHP autodiscovery.
Pull Request for Issue #14993.
Added support to allow auto discovery of memcached nodes from AWS ElastiCache PHP client.
Prerequisite documentation for autodiscovery configuration.
Installing the ElastiCache Cluster Client for PHP.
Compiling the Source Code for the ElastiCache Cluster Client for PHP
Configure your configuration.php as follows:
public cache_handler = 'memcachedaws'
...
public $memcached_persist = '1';
public $memcached_compress = '1';
public $memcached_server_host = 'your-elasticache-endpoint';
public $memcached_server_port = '11211';
public $memcached_autodiscovery = '1';
...
public session_handler = 'memcached'
public $session_memcached_server_host = 'your-elasticache-endpoint';
public $session_memcached_server_port = '11211';
The configuration.php file will be required to be modified to include the following line:
public $memcached_autodiscovery = '1';
This will allow you to turn on the auto discovery to register all the memcached nodes in your cluster with the Joomla Memcached.
Using Auto Discovery Caching with multiple Memcached nodes. You can login and you will not be logged out before the session expiration as you are routed to the nodes in your cluster.
When turning off auto discovery the caching behavior remains same as before this change.
Caching in memcached & session management hits.
I have updated the "administrator/components/com_config/model/form/application.xml"
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_config Language & Strings Libraries |
Labels |
Added:
?
?
|
@brianteeman Thanks sorry I didn't realize I opened two issues.
The Travis CI failed because of the dependency on AWS memcached module. Do you need me to work through that?
This made me realize I also need to test this pull on a server using the standard PHP memcached module. I will do this tomorrow and fix code as needed to pass the CI build.
We might have to do this as a subclass of the Memcached adapter versus including it inline if it has an additional dependency. That's my first thought.
I can subclass the memcached class, if that is preferred. It is a different implementation of the memcached module. Let me know your preference and any tips.
@mbabker @brianteeman BTW - I stumbled upon this issue when trying to use a memcached multi-node cluster with Session Management. The constructor in the memcached.php file had the following //todo. This can be fixed using AWS autodiscovery. I did not remove the //todo in my PR but we can remove if you agree or add a note or leave alone.
// This will be an array of loveliness // @todo: multiple servers $this->_servers = array( array( 'host' => $config->get('session_memcached_server_host', 'localhost'), 'port' => $config->get('session_memcached_server_port', 11211), ), );
Looking forward to your feedback.
IMO subclass will be better.
There is a method isSupported()
which has to be overrided.
Status | Pending | ⇒ | Discussion |
Added subclass for review and updated ticket documentation for setting up AWS ElastiCache.
Will finish testing on my side next week. Going to create a Apache JMeter load script to test performance and dynamically adding/removing nodes.
I did not override isSupported() AWS uses same Memcached class
@jdolinski i have just commited some CS Changes and extended doc blocks 91fd32e
I mentioned about isSupported()
in order to add a condition: if Memcached::OPT_CLIENT_MODE
is defined.
Gotcha, will override that method
I overrode the isSupported() method, please review latest changes. Will be pushing this version to production (on our side) and begin using with AWS ElastiCache.
Created Apache Jmeter test and discovered bug under load, refactored the dynamic connection code. Was able to add/remove memcached nodes while simulating user connections to multiple pages in test.
Title |
|
Title |
|
@brianteeman I ran performance tests against memcached and found my site is slower. Very similar and appears to be related to #9898. I will take a look at the comments and see if I can help. Maybe this is the reason the cache handler is still marked as "Experimental"?
Category | Administration com_config Language & Strings Libraries | ⇒ | Administration com_config Libraries |
Hi @jdolinski,
thx for the time you invested into this PR. We can't merge it into J3 because of the feature freeze.
I'm also not sure if this is the right why to get it into J4 a plugin system for cache/session stores would be a better approach but if you are still interested to get this cache store into Joomla! it would be great if you rebase it for J4.
In the meantime I close this PR, thx for trying to make Joomla! a better CMS.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-07-01 22:09:10 |
Closed_By | ⇒ | HLeithner |
Category | Administration com_config Libraries | ⇒ | Administration com_config Language & Strings Libraries |
As you can see the travis continuous integration tests are failing with
Fatal error: Undefined class constant 'OPT_CLIENT_MODE' in /home/travis/build/joomla/joomla-cms/libraries/joomla/cache/storage/memcached.php on line 88