Due to a request from my non-profit organization I revisited the Moodle issue. I was able to have the ec2 instance connect to the proper data folders in the EFS system. I have a clarification about the permissions required from my previous post. It is important that permissions be copied along with files, using sudo makes the files accessible only as root, which the apache server is definitely not. The two commands that worked were:
sudo chown -R --reference=/home/bitnami/apps/moodle/moodledata/ /home/bitnami/efs/moodledatashared/moodledata
sudo chmod -R --reference=/home/bitnami/apps/moodle/moodledata/ /home/bitnami/efs/moodledatashared/moodledata
Next issue was that most pictures were not showing up properly, looking around online the solution was to clear the cache and allow the instance to reestablish a proper cache. I mounted the local cache to the EBS drive and rebooted apache, the website was loading much faster. I am now going to hold off on using elasticache because the EBS drive should meet our data and storage capacity needs. I reconfigured the Config.php file as seen below:
CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'moodle.*********.*******.rds.amazonaws.com';
$CFG->dbname = 'bitnami_moodle';
$CFG->dbuser = '****';
$CFG->dbpass = '****';
$CFG->prefix = 'mdl_';
$CFG->localcachedir = '/home/bitnami/apps/moodle/moodledata';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => 3306,
'dbsocket' => 0,
'dbcollation' => 'utf8_general_ci',
After this I edited F-stab again to add the mounting location on server bot, and I was able to launch new instances already mounted to my EFS drive. I then saved the image and started to launch a test system which I am going to load test. I loaded the Image behind a HTTPS load balancer targeting T2 Micro ec2 instances, currently I have 2 instances running with a max of 6.
I then used Apache Bench marking tool and ran the following test:
ab -n 1000 -c 15 http://test.site.org/
## I received the following response:
Server Software: Apache
Server Hostname: test.****.org
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key: ECDH P-256 256 bits
TLS Server Name: test.jamat.org
Document Path: /
Document Length: 148997 bytes
Concurrency Level: 15
Time taken for tests: 240.115 seconds
Complete requests: 1000
Failed requests: 1
(Connect: 0, Receive: 0, Length: 1, Exceptions: 0)
Non-2xx responses: 1
Total transferred: 149460662 bytes
HTML transferred: 148848125 bytes
Requests per second: 4.16 [#/sec] (mean)
Time per request: 3601.728 [ms] (mean)
Time per request: 240.115 [ms] (mean, across all concurrent requests)
Transfer rate: 607.87 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 4 1.0 4 15
Processing: 1 3573 1779.3 3393 11870
Waiting: 1 1957 1618.5 1768 8857
Total: 5 3577 1779.4 3396 11874
Percentage of the requests served within a certain time (ms)
50% 3396
66% 4152
75% 4873
80% 5072
90% 5649
95% 6582
98% 8889
99% 9379
100% 11874 (longest request)
Out of 1000 requests completed with 15 concurrent users, most users have loaded the website in 5 seconds. However to serve 100% of users the longest request was 11 seconds. This seems a bit slow. I am thinking I should move the shared folder to a dedicated EC2 data server rather than EFS.