Amazon Elastic Beanstalk & DynamoDB
Permalink 2 users found helpfulI have a simple piece of test code that runs outside of C5, sets up the session and then writes/reads the current time into a session array variable. This works without error, retrieving the previous values with no problem.
Since the AWS setup is in fact a reverse proxy, I am wondering if there are any cache headers that C5 might be sending that are causing the load balancer to not forward the requests, but to serve the request from its cache.

How have you found performance to be on Elastic Beanstalk? I tried to set up a C5 install using an EC2 instance with the database on an RDS instance and found the latency between the two instances resulted in unacceptably slow performance. Running MySQL on the EC2 instance solved the problem.
I actually thought the performance was quite snappy, to be honest - at least as good as my regular hosting platform which uses a localhost mysql. Maybe it's an availability zone thing. All my zones are in Sydney, which is closest to me.
I did run into the slow RDS problem. You just have to make sure your instances and RDS are in the same Availability Zone. I like to set up my own RDS instead of going through EB, and it takes an extra step to make sure they are the same.
Would you be able to share the session management configuration to use DynamoDB as the session management. I am just starting with Concrete5 and would like to save some time ;)
Many thanks
Jason
<?php require 'aws/aws-autoloader.php'; use Aws\DynamoDb\DynamoDbClient; use Aws\DynamoDb\Session\SessionHandler; $dynamoDb = DynamoDbClient::factory(array( 'region' => 'ap-southeast-2', 'credentials' => array( 'key' => 'ZZZZZZZZZZZ, // These are also defined as AWSKEY and AWSSECRET in config/site.php 'secret' => 'SSSSSSSSSSS' // but we need them here too before the file is loaded ) )); $sessionHandler = SessionHandler::factory(array( 'session_lifetime' => 7200, // 2 hours 'dynamodb_client' => $dynamoDb, 'table_name' => 'sessions',
The AWS SDK for PHP can be found somewhere on Amazon's website - I recall it took a while to find the right bits, and IIRC correctly it requires composer to get it configured correctly. I can't quite remember.
You will also need a scheduled job to kill off old session files, or kill them off by some other means
<?php defined('C5_EXECUTE') or die("Access Denied."); use Aws\DynamoDb\DynamoDbClient; use Aws\DynamoDb\Session\SessionHandler; class Dynamo extends Job { public function getJobName () { return t("Clear Dynamo Sessions"); } public function getJobDescription () { return t("Run the DynamoDB Garbage Collection Process"); } public function run () { $dynamoDb = DynamoDbClient::factory(array( 'region' => 'ap-southeast-2', 'credentials' => array( 'key' => AWSKEY,
I cant help noticing that there are a number of references to apk keys in the code.
How about using Roles to spin up the instance that would have the correct access to the resources (DynamoDB) to achieve the same result?
This would also result in a more secure enviromment as there is no API key to gain should there be an unwelcome visitor :)
Thanks for all your help so far
I cant help noticing that there are a number of references to apk keys in the code.
How about using Roles to spin up the instance that would have the correct access to the resources (DynamoDB) to achieve the same result?
This would also result in a more secure enviromment as there is no API key to gain should there be an unwelcome visitor :)
Thanks for all your help so far