tencent cloud

All product documents
Cloud Log Service
Pay-As-You-Go Examples
Last updated: 2025-03-21 16:46:12
Pay-As-You-Go Examples
Last updated: 2025-03-21 16:46:12

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 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
Using LogListener will batch upload logs in groups, generating about 100,000 upload requests.
0.1 million times
0.026 USD/million times/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)

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
55 GB × 15 = 825 GB
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 times/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. "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 the log search and analysis features. Without indexes, it will be completely impossible to retrieve log data. Therefore, the unit price of index traffic (0.062 USD/GB/day) is higher than that of write traffic (0.032 USD/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

Traffic Fees

Billing Item
Description
Billing Formula
Log write traffic fee
If the system uploads logs and ships the processed data to the target log topic, write traffic fee will occur. Billing is based on the amount of data received by CLS, regardless of the private and public network.
Note:
Compressed upload logs will be billed based on the actual compressed data volume (LogListener uses compressed upload by default). For example, if the original log data volume is 4 GB, and the write traffic after compression is 1 GB (calculated based on a compression ratio of 1:4. The compression ratio depends on the actual log content and generally ranges from 1:4 to 1:10).
Write traffic fee = Unit price per GB × Daily accumulated write traffic
Metric write traffic fee
Generated traffic is not compressed in the following scenarios: collected data is written to a target metric topic result data that is generated by scheduled SQL analysis tasks is written to a target metric topic. Metric write only generates write traffic and does not generate index traffic.
Global acceleration write traffic fee
Additional traffic fees incurred by writing logs and metric data using the global acceleration feature.
Note:
Writing logs and metrics will simultaneously generates log write traffic fee and metric write traffic fee will still be incurred simultaneously.
This traffic fee will be incurred only if the global acceleration feature is used, and not for regular public network access.
STANDARD/STANDARD_IA index traffic fee (logs)
The index traffic fee incurred during the creation of STANDARD or STANDARD_IA indexes for logs is billed based on the amount of data generated by CLS when building indexes.
Note:
Index traffic will be generated only after the indexing is enabled.
In CLS, built-in reserved fields such as __FILENAME__ and __SOURCE__ will be automatically used for creating key-value indexes, but will not be used to calculate index traffic.
Index traffic is independent of whether compression is performed during log upload and is calculated based on the amount of uncompressed raw log data. For example, if the amount of raw log data is 4 GB and the write traffic after compression is 1 GB (calculated at a compression ratio of 1:4), the corresponding index traffic after enabling the full-text index is 4 GB.
If both the full-text index and key-value index are enabled, the index traffic will not be calculated repeatedly and will be calculated based on the full-text index (namely, the size of the full log). If only the key-value index is enabled, the index traffic is related to the number of fields with the key-value index enabled and the field value size. For example, if the amount of raw log data is 4 GB and the size of the fields and field values with the key-value index enabled is 2 GB, the corresponding index traffic is 2 GB. Reasonably configuring key-value index fields can save product usage costs.
STANDARD/STANDARD_IA index traffic has different prices and is billed separately.
STANDARD index traffic fee = Unit price per GB × Daily accumulated STANDARD index traffic
STANDARD_IA index traffic fee = Unit price per GB × Daily accumulated STANDARD_IA index traffic
Private network read traffic fee
Billing based on the downstream traffic generated if the private network domain name of CLS is accessed.
For example, consuming logs, shipping metrics, shipping to Cloud Object Storage (COS), and shipping to TDMQ for CKafka (CKafka) within the same region through the private network do not generate read traffic and fees if logs are retrieved and analyzed through the console or API.
Private network read traffic fee = Unit price per GB × Daily accumulated private network read traffic
Public network read traffic fee
Billing based on the downstream traffic generated if the public network domain name of CLS is accessed.
For example, downloading logs, consuming logs, shipping metrics, shipping to COS, and shipping to CKafka through the public network do not generate read traffic and fees if logs are retrieved and analyzed through the console or API.
Public network read traffic fee = Unit price per GB × Daily accumulated public network read traffic

Storage Fees

Billing Item
Description
Billing Formula
STANDARD/STANDARD_IA log storage fee
Billing is based on the size of STANDARD or STANDARD_IA storage space occupied by log data.
Note:
Compressed upload logs are billed based on the actual compressed data volume ( LogListener uses compressed upload by default). For example, if the raw log data volume is 4 GB and the write traffic after compression is 1 GB (calculated based on a compression ratio of 1:4; the compression ratio depends on the actual log content and generally ranges from 1:4 to 1:10), then the increment of the corresponding log storage is 1 GB.
STANDARD log storage fee = Unit price per GB × Daily average STANDARD log storage volume

STANDARD_IA log storage fee = Unit price per GB × Daily average STANDARD_IA log storage volume
STANDARD/STANDARD_IA index storage fee (logs)
Billing is based on the size of STANDARD or STANDARD_IA storage space occupied by log index data.
Note:
The index storage size is independent of whether the log is compressed during upload. It is calculated based on the amount of uncompressed original log data. For example, if the amount of raw log data is 4 GB, the write traffic after compression is 1 GB (calculated based on a compression ratio of 1:4), and the index traffic is 4 GB after the full-text index is enabled, then the increment of the corresponding index storage is 4 GB.
STANDARD index storage fee = Unit price per GB × Daily average STANDARD index storage
STANDARD_IA index storage fee = Unit price per GB × Daily average STANDARD_IA index storage
Metric storage fee
Without compression, the size of metric storage is positively correlated with the size of metric write traffic and the duration of metric storage. Metric storage does not generate index storage volume.
Metric storage fee = Unit price per GB × Daily average metric storage volume
1. STANDARD/STANDARD_IA logs and indexes have different storage prices and are billed separately.
2. The measurement method for storage volume adopts the averaging method. The storage volume of a specified point is collected every hour of a day, and then the average of 24-hour values is calculated as the storage volume of the day.
3. Log and metric data will be stored based on a retention period set by a user. Storage fees will no longer be calculated after the data expires. The expired data volume is deducted at the first full hour after the end of the retention period.
For example, if a retention period is set to 3 days, and logs are uploaded at 12:15 on June 15, the effective storage period is from 12:15 on June 15 to 12:15 on June 18. The storage space occupied by expired data will be deducted at 13:00 on June 18. (It is not recommended that users frequently modify a retention period. A retention period can be modified at most once a day.)
Extend a retention period
After a retention period is extended, CLS will extend the retention of valid data within the current retention period. For example, if you extend a retention period from 7 days to 15 days at 12:30 on June 15, the data generated after 12:00 on June 8 will not be deleted at 13:00 on June 15, but will be retained until 13:00 on June 23.
Shorten a retention period
After a retention period is shortened, CLS will shorten the retention of valid data within the current retention period. For example, if you shorten a retention period from 15 days to 7 days at 12:30 on June 15, the data generated from 12:00 on June 1 to 13:00 on June 8 will be deleted at 13:00 on June 15.

Calculation Fees

Billing Item
Description
Billing Formula
Data processing fee
Billing is based on the amount of log data processed.
Note:
The size of log data is independent of whether it is compressed during upload. It is calculated based on the uncompressed raw log data volume. For example, if the raw log data volume is 4 GB and the write traffic after compression is 1 GB (calculated based on a compression ratio of 1:4; the compression ratio depends on the actual log content and generally ranges from 1:4 to 1:10), the data volume during data processing is 4 GB.
Data processing fee = Unit price × Amount of processed log data

Other Fees

Billing Item
Description
Billing Formula
Service request fee
Billing is based on the total number of calls to CLS APIs for reporting logs or metric data, including LogListener, APIs and SDKs. All calls, whether successful or failed, will be counted.
Service request fee = Unit price per million requests × (Number of daily accumulated requests/1000000)
Topic partition fee
Billing is based on the number of occupied topic partitions, including topic partitions in the read/write and read-only states.
Topic partition fee = Unit price × Number of daily accumulated topic partitions
The unit prices of service request fee and topic partition fee are relatively low. If product features are used normally, their proportion of the total fees is very low. This configuration is used to prevent abuse, such as meaningless high-concurrency calls to APIs.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon