Skip to content

Commit 7cb0c17

Browse files
Merge pull request #14 from aws-samples/blog-guidance
Amazon ElastiCache Caching for RDS Guidance
2 parents f15ec18 + b06e663 commit 7cb0c17

9 files changed

+65
-110
lines changed

guidance/.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
3+
14
export EC_REDIS_HOST=<ElastiCache endpoint>
25
export EC_REDIS_PORT=6379
36
export MYSQL_USER=admin

guidance/guidance-ec2.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
3+
14
AWSTemplateFormatVersion: '2010-09-09'
25
Transform: 'AWS::Serverless-2016-10-31'
3-
Description: Create and EC2 to demonstrate the benefits of pairing RDBSM workloads with AWS ElastiCache
6+
Description: Create and EC2 to demonstrate the benefits of pairing RDBMS workloads with AWS ElastiCache
47
Metadata:
58
AWS::CloudFormation::Interface:
69
ParameterGroups:
@@ -26,7 +29,6 @@ Parameters:
2629
AppInstanceClass:
2730
Description: 'The application EC2 instance class'
2831
Type: String
29-
# Default: c6g.xlarge
3032
Default: t4g.micro
3133
MinLength: '8'
3234
MaxLength: '63'
@@ -35,15 +37,15 @@ Parameters:
3537
AppInstanceSecurityGroup:
3638
Description: 'A security group with inbound rules for SSH connectivity from customer computer. And RDBMS and ElastiCache'
3739
Type: String
38-
Default: sg-0a87f73dcc1dffc4f
40+
Default: a-valid-sg-that-allows-ssh-database-and-EC-access
3941
MinLength: '8'
4042
MaxLength: '63'
4143
# AllowedPattern: "^[a-zA-Z]+[0-9]+[-]*$"
4244

4345
AppInstanceSubnet:
4446
Description: 'A valid subnet name in the default VPC'
4547
Type: String
46-
Default: subnet-05cfa282f9b9dc8df
48+
Default: pick-a-valid-subnet
4749
MinLength: '8'
4850
MaxLength: '63'
4951
# AllowedPattern: "^[A-Za-z]+[0-9A-Z-]*$"
@@ -75,7 +77,15 @@ Resources:
7577
SecurityGroupIds:
7678
- !Ref AppInstanceSecurityGroup
7779
SubnetId: !Ref AppInstanceSubnet
80+
BlockDeviceMappings:
81+
- DeviceName: "/dev/xvda"
82+
Ebs:
83+
VolumeType: "io1"
84+
Iops: "200"
85+
DeleteOnTermination: "true"
86+
VolumeSize: !Ref AppInstanceStorage
87+
Encrypted: "true"
7888
Tags:
7989
-
8090
Key: Name
81-
Value: !Ref AppInstanceName
91+
Value: !Ref AppInstanceName

guidance/plot_results_db_and_cache.ipynb

+15-1
Large diffs are not rendered by default.

guidance/plot_results_db_only.ipynb

+15-1
Large diffs are not rendered by default.

guidance/requirements.txt

+4-102
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,6 @@
1-
aiofiles==22.1.0
2-
aiosqlite==0.19.0
3-
anyio==3.7.1
4-
argon2-cffi==23.1.0
5-
argon2-cffi-bindings==21.2.0
6-
arrow==1.2.3
7-
async-timeout==4.0.3
8-
attrs==23.2.0
9-
Babel==2.14.0
10-
backcall==0.2.0
11-
beautifulsoup4==4.12.3
12-
bleach==6.0.0
13-
cached-property==1.5.2
14-
certifi==2024.2.2
15-
cffi==1.15.1
16-
charset-normalizer==3.3.2
17-
cycler==0.11.0
18-
debugpy==1.7.0
19-
decorator==5.1.1
20-
defusedxml==0.7.1
21-
entrypoints==0.4
22-
exceptiongroup==1.2.0
23-
fastjsonschema==2.19.1
24-
fonttools==4.38.0
25-
fqdn==1.5.1
26-
greenlet==3.0.3
27-
idna==3.6
28-
importlib-metadata==6.7.0
29-
importlib-resources==5.12.0
30-
ipykernel==6.16.2
31-
ipython==7.34.0
32-
ipython-genutils==0.2.0
33-
isoduration==20.11.0
34-
jedi==0.19.1
35-
Jinja2==3.1.3
36-
json5==0.9.16
37-
jsonpointer==2.4
38-
jsonschema==4.17.3
1+
python-decouple==3.8
2+
redis==5.0.4
3+
SQLAlchemy==2.0.30
394
jupyter-events==0.6.3
405
jupyter-server==1.24.0
416
jupyter-ydoc==0.2.5
@@ -45,67 +10,4 @@ jupyter_server_fileid==0.9.1
4510
jupyter_server_ydoc==0.8.0
4611
jupyterlab==3.6.7
4712
jupyterlab-pygments==0.2.2
48-
jupyterlab_server==2.24.0
49-
kiwisolver==1.4.5
50-
markdown-it-py==2.2.0
51-
MarkupSafe==2.1.5
52-
matplotlib==3.5.3
53-
matplotlib-inline==0.1.6
54-
mdurl==0.1.2
55-
mistune==3.0.2
56-
nbclassic==1.0.0
57-
nbclient==0.7.4
58-
nbconvert==7.6.0
59-
nbformat==5.8.0
60-
nest-asyncio==1.6.0
61-
notebook==6.5.6
62-
notebook_shim==0.2.4
63-
numpy==1.21.6
64-
packaging==24.0
65-
pandas==1.3.5
66-
pandocfilters==1.5.1
67-
parso==0.8.3
68-
pexpect==4.9.0
69-
pickleshare==0.7.5
70-
Pillow==9.5.0
71-
pkgutil_resolve_name==1.3.10
72-
prometheus-client==0.17.1
73-
prompt-toolkit==3.0.43
74-
psutil==5.9.8
75-
ptyprocess==0.7.0
76-
pycparser==2.21
77-
Pygments==2.17.2
78-
PyMySQL==1.1.0
79-
pyparsing==3.1.2
80-
pyrsistent==0.19.3
81-
python-dateutil==2.9.0.post0
82-
python-decouple==3.8
83-
python-json-logger==2.0.7
84-
pytz==2024.1
85-
PyYAML==6.0.1
86-
pyzmq==24.0.1
87-
redis==5.0.3
88-
requests==2.31.0
89-
rfc3339-validator==0.1.4
90-
rfc3986-validator==0.1.1
91-
rich==13.7.1
92-
Send2Trash==1.8.2
93-
six==1.16.0
94-
sniffio==1.3.1
95-
soupsieve==2.4.1
96-
SQLAlchemy==2.0.29
97-
terminado==0.17.1
98-
tinycss2==1.2.1
99-
tomli==2.0.1
100-
tornado==6.2
101-
traitlets==5.9.0
102-
typing_extensions==4.7.1
103-
uri-template==1.3.0
104-
urllib3==1.26.6
105-
wcwidth==0.2.13
106-
webcolors==1.13
107-
webencodings==0.5.1
108-
websocket-client==1.6.1
109-
y-py==0.6.2
110-
ypy-websocket==0.8.4
111-
zipp==3.15.0
13+
jupyterlab_server==2.24.0

guidance/scenario01.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
3+
14
import json
25
import random
36
import threading

guidance/scenario02.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: MIT-0
3+
14
import json
25
import random
36
import threading

guidance/setup_host.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22
#
3+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
# SPDX-License-Identifier: MIT-0
5+
36
sudo yum install gcc python3-devel -y
47
python3 -m venv .venv
58
source .venv/bin/activate

guidance/setup_jupyter.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
22
#
3+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
# SPDX-License-Identifier: MIT-0
5+
36
# debug flags
4-
#set -ex
7+
# set -ex
58
source .venv/bin/activate
69

710
echo 'y' | jupyter notebook --generate-config

0 commit comments

Comments
 (0)