Skip to content

moiamond/aws-ff-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

測試 AWS EC2 機器轉檔效能

前製作業

取得 Access Key ID 和 Secret Access Key

  1. IAM 建立 User 並給他相對應的權限
  2. 拿到 User 的 Secret Credentials

註: AWS 參考文件

安裝 AWS CLI

$ pip install awscli

更詳細的步驟,可以參考 AWS CLI 安裝手冊

設定 AWS CLI

$ aws configure
AWS Access Key ID [None]: AWS_ACCESS_KEY_ID
AWS Secret Access Key [None]: AWS_SECRECT_ACCESS_KEY
Default region name [None]: ap-northeast-1
Default output format [None]: ENTER

0.5 上傳測試檔

  1. 上傳測試檔到 S3
  2. 取得公開下載網址

1. 啟動

$ ./benchmark.sh EC2_TYPE MEDIA_ON_S3_URL

註: EC2_TYPE : t2.micro or c4.large, See EC2 Instance Type


附錄

Launch EC2 instance

Create a Key Pair for the EC2 Instance

$ aws ec2 create-key-pair --key-name MyKeyPair --query "KeyMaterial" --output text > MyKeyPair.pem

Launching an Instance

$ aws ec2 run-instances --image-id ami-0c11b26d --count 1 --instance-type t2.micro --key-name MyKeyPair 

Connect to your instance

$ aws ec2 describe-instances --instance-ids i-a518e53b --query "Reservations[0].Instances[0].PublicIpAddress"
"52.199.86.109"
$ ssh -i MyKeyPair.pem ubuntu@52.199.86.109

Terminating Your Instance

$ aws ec2 terminate-instances --instance-ids i-a518e53b
{                                              
    "TerminatingInstances": [                  
        {                                      
            "CurrentState": {                  
                "Code": 32,                    
                "Name": "shutting-down"        
            },                                 
            "PreviousState": {                 
                "Code": 16,                    
                "Name": "running"              
            },                                 
            "InstanceId": "i-a518e53b"         
        }                                      
    ]                                          
}                                              

Delete a Key Pair for the EC2 Instance

$ aws ec2 delete-key-pair --key-name MyKeyPair

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages