tencent cloud

Cloud Log Service

Pay-As-You-Go Examples

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-10-16 17:15:30
AI 번역

Billing Examples

Nginx Log Query and Analysis

Company A's website receives 100 million requests per day, with each request generating a log of about 100 bytes, totaling 100 million logs per day, approximately 9.31 GB of log data. Company A decides to upload Nginx access logs to the Beijing region of Cloud Log Service (CLS) for storage. The company uses STANDARD storage for 15 days and uses the log search, analysis, and alarm features, without using the data processing, downloading, consumption, or shipping features.
Billing by Feature
Billing by Raw Log Volume
Billing Item
Description
Measurement
Unit Price
Pay-As-You-Go Fees
Write traffic fee
Logs uploaded by using LogListener will be compressed, with a compression ratio of about 1:4, and the traffic after compression is 2.33 GB.
9.31 GB × (1:4) = 2.33 GB
0.032 USD/GB/day
0.0745 USD/day
STANDARD index traffic fee
Enabling the full-text index is equivalent to enabling the index for 100% of the fields, generating 9.31 GB of index traffic.
9.31 GB × 100% = 9.31 GB
0.062 USD/GB/day
0.5772 USD/day
STANDARD log storage fee
Upload 9.31 GB of logs per day, which is about 2.33 GB after compression. If the logs are saved for 15 days, the average daily storage volume is 34.95 GB.
9.31 GB × (1:4) × 15 = 34.95 GB
0.0024 USD/GB/day
0.0838 USD/day
STANDARD index storage fee
Produce 9.31 GB of indexes per day, and the average storage volume is 139.65 GB after the indexes are saved for 15 days.
For more details, see Billing Overview.
9.31 GB × 15 = 139.65 GB
0.0024 USD/GB/day
0.3351 USD/day
Service request fee
When LogListener is used, logs are uploaded in batches by group, generating about 100,000 upload requests.
0.1 million times
0.026 USD/million requests/day
0.0026 USD/day
Topic partition fee
The peak value of business logs is 8 MB/s, requiring two topic partitions.
2
0.007 USD/partition/day
0.014 USD/day
Total
1.09 USD/day (rounded to 2 decimal places)
Billing Item
Description
Measurement
Unit Price
Pay-As-You-Go Fees
Raw log volume (standard)
The volume of uncompressed raw logs is about 9.31 GB.
9.31GB
0.053 USD/GB/day
0.49343 USD/day
Total
0.49 USD/day (rounded to 2 decimal places)
Logs are stored for 15 days, which does not exceed the 30-day free storage period, so no storage fees are incurred.

Host Metrics Monitoring

Company A needs to monitor metrics such as CPU or memory usage of hosts. Each host collects about 50 metrics every 15 seconds, with a total of 1,000 hosts. Collect the metrics into a metric topic and save them for 15 days. Use the metric search and analysis and alarm features, but not the metric shipping feature.
Billing Item
Description
Measurement
Unit Price
Pay-As-You-Go Fees
Metric write traffic fee
Collect 50,000 metrics (equal to 50 metrics per unit times 1,000 units) each time. Estimate each metric at 0.2 KB. Each collection generates approximately 0.0095 GB (equal to 50,000 times 0.2 KB) of metric data.
Collect 5,760 times (equal to 86,400 seconds divided by 15 seconds) per day, generating approximately 55 GB of metric data.
55 GB
0.043 USD/GB/day
2.365 USD/day
Metric storage fee
55GB × 15 = 825GB
0.0009 USD/GB/day
0.7425 USD/day
Service request fee
Each host generates one request for metric collection per time, resulting in approximately 5.76 million upload requests.
5.76 million times
0.026 USD/million requests/day
0.1497 USD/day
Topic partition fee
If traffic does not exceed 5 MB/s, only 1 topic partition is required.
1
0.007 USD/partition/day
0.007 USD/day
Total
3.26 USD/day (rounded to 2 decimal places)

Nginx Log Data Processing

Assume that the business needs to use data processing to distribute Nginx logs (source log topic) based on the value of "Status". If the value of "Status" is 200, the logs are distributed to the target log topic named "Nginx_200"; if the value of "Status" is 400, the logs are distributed to the target log topic named "Nginx_400". The log volume of the source log topic is 9.31 GB/day. Assume that the log volume is 8.9 GB if the value of "Status" is 200, the log volume is 0.1 GB if the value of "Status" is 400, indexes are not enabled for the target topics, and the target topics are stored for 15 days. Then the following fees will be incurred:
Billing Item
Description
Measurement
Unit Price
Pay-As-You-Go Fees
Data processing fee
(source log topic)
The traffic of the source log topic is 9.31 GB per day, which is equal to the traffic of data processing.
9.31GB
0.026 USD/GB/day
0.242 USD/day
Write traffic fee (target log topics: Nginx_200 and Nginx_400)
The processed result logs will be written to the 2 target log topics. The size of the logs whose "Status" is 200 is 8.9 GB, and the size of the logs whose "Status" is 400 is 0.1 GB, totaling 9 GB. The writing compression rate is approximately 1:2, and the write traffic after compression is 4.5 GB.
(8.9 GB + 0.1 GB) × (1:2) = 4.5 GB
0.032 USD/GB/day
0.144 USD/day
STANDARD log storage fee (target log topics Nginx_200 and Nginx_400)
Write 4.5 GB of logs to the 2 target log topics every day. If the logs are stored for 15 days, the average daily storage volume is 67.5 GB.
(8.9 GB+0.1 GB) × (1:2) × 15 = 67.5 GB
0.0024 USD/GB/day
0.162 USD/day
Topic partition fee (target log topics: Nginx_200 and Nginx_400)
The peak value of business logs is 8 MB/s. "Nginx_200" requires 2 topic partitions, and "Nginx_400" requires 1 topic partition.
3 partitions
0.007 USD/partition/day
0.021 USD/day
Total
0.57 USD/day (rounded to 2 decimal places)
From the billing item fees, it can be found that the index traffic and index storage fees are the highest, mainly caused by the following aspects:
Indexes are the core of log search and analysis. Without indexes, log data cannot be searched at all. Therefore, the unit price of index traffic (USD 0.062/GB/day) is also higher than that of write traffic (USD 0.032/GB/day).
If the uploaded logs are compressed, the write traffic and log storage will be calculated based on the compressed log data volume, while the index traffic and index storage need to be calculated based on the uncompressed raw data volume. Since the compression ratio of logs is generally between 1:4 and 1:10, the measurement of index traffic and index storage will be 4 to 10 times that of write traffic and log storage.
Therefore, if you need to reduce product usage costs, you can reasonably adjust the index configuration to reduce index traffic and index storage.
A sample raw log is shown as follows:
10.20.20.10 ::: [Tue Jan 22 14:49:45 CST 2019 +0800] ::: GET /online/sample HTTP/1.1 ::: 127.0.0.1 ::: 200 ::: 647 ::: 35 ::: http://127.0.0.1/
If the log is collected, the system extracts the log into the following fields:
IP: 10.20.20.10
bytes: 35
host: 127.0.0.1
length: 647
referer: http://127.0.0.1/
request: GET /online/sample HTTP/1.1
status: 200
time: [Tue Jan 22 14:49:45 CST 2019 +0800]
If the full-text index is enabled, the index size generated by this log is 172 bytes (the size of all field keys and field values), and corresponding index traffic and index storage will be generated.
If only the key-value index is enabled for the request and status fields without enabling the full-text index, the index size generated by this log is 48 bytes (the size of the key and value of the request and status fields, which is equivalent to enabling the key-value index for 27.9% of the fields, in which 27.9% is equal to 48 bytes divided by 172 bytes). The index traffic and index storage are reduced to 27.9% of the full-text index. However, it should be noted that at this time, logs can only be retrieved and analyzed through the request and status fields, and other fields are only for viewing.
For more ways to reduce product usage costs, see Cost-Saving Recommendations.

Detailed Description of Billing Items

For details, see Billing Overview.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백