问题
I have an ec2 instance which is running apache application.
I have to store my apache log somewhere. For this, I have used two approaches:
- Cloudwatch Agent to push logs to cloudwatch
- CronJob to push log file to s3
I have used both of the methods. Both methods suit fine for me. But, here I am little worried about the costing.
Which of these will have minimum cost?
回答1:
S3 Pricing is basically is based upon three factors:
- The amount of storage.
- The amount of data transferred every month.
- The number of requests made monthly.
The cost for data transfer between S3 and AWS resources within the same region is zero.
According to Cloudwatch pricing for logs :
All log types. There is no Data Transfer IN charge for any of CloudWatch.Data Transfer OUT from CloudWatch Logs is priced.
Pricing details for Cloudwatch logs:
- Collect (Data Ingestion) :$0.50/GB
- Store (Archival) :$0.03/GB
- Analyze (Logs Insights queries) :$0.005/GB of data scanned
Refer CloudWatch pricing for more details.
Similarly, according to AWS, S3 pricing differs region wise.
e.g For N.Virginia :
S3 Standard Storage
- First 50 TB / Month :$0.023 per GB
- Next 450 TB / Month :$0.022 per GB
- Over 500 TB / Month :$0.021 per GB
Refer S3 pricing for more details.
Hence, we can conclude that sending logs to S3 will be more cost effective than sending them to CloudWatch.
回答2:
They both have similar storage costs, but CloudWatch Logs has an additional ingest charge.
Therefore, it would be lower cost to send straight to Amazon S3.
See: Amazon CloudWatch Pricing – Amazon Web Services (AWS)
来源:https://stackoverflow.com/questions/55472308/cloudwatch-log-store-costing-vs-s3-costing