If you want to transfer logs over long distances, you can enable the transfer acceleration feature. For example, you can use the transfer acceleration feature to write logs from regions outside the Chinese mainland to regions in the Chinese mainland. The transfer acceleration feature uses cloud data centers distributed around the world to intelligently route and parse the access requests from users across the globe to Simple Log Service to the nearest access points. The optimized networks and protocols significantly increase the access speed.
Scenarios
Data collection from mobile devices. For more information, see Use the web tracking feature to collect logs, aliyun-log-android-sdk, and aliyun-log-c-sdk.
Long-distance data transfer in other scenarios
Billing description
When you use an acceleration endpoint to write data, upload acceleration traffic is generated. When you use an acceleration endpoint to read data, download acceleration traffic and outbound traffic over the Internet are generated. For example, when you use an acceleration endpoint to read 1 GB of data from a project for which the transfer acceleration feature is enabled, you are charged a transfer acceleration fee for 1 GB of data and a traffic fee for 1 GB of outbound traffic over the Internet.
The transfer acceleration fee is calculated based on the actual amount of transferred data. For example, if you compress the data before you upload the data, the fee is calculated based on the traffic generated when the compressed data is uploaded. To calculate the transfer acceleration fee, you can use the following formula: Transfer acceleration fee = Uplink and downlink traffic generated for transfer acceleration × Price per GB of traffic. For more information about the billing, see Billable items of pay-by-ingested-data and Billable items of pay-by-feature.
Step 1: Enable the transfer acceleration feature for a project
Simple Log Service console
Log on to the Simple Log Service console.
Find the project that you want to manage and go to the Project Overview page of the project. For more information, see Manage a project.
On the Project Overview page, click Enable next to Acceleration Endpoint.
In the Confirm to Enable Transfer Acceleration dialog box, read the prompt and click Modify.
Step 2: Use the transfer acceleration feature
The following list describes the scenarios in which you can use the transfer acceleration feature:
Logtail-based log collection: For more information, see Log collection acceleration.
Data transformation: When you create a data transformation job in which data needs to be transferred between projects across regions, you can enable the transfer acceleration feature. For more information, see Get started with data transformation.
Simple Log Service SDK: When you use Simple Log Service SDK, you must set
endpoint
to an acceleration endpoint to enable the transfer acceleration feature. If the feature is no longer required, we recommend that you modify endpoint to a common endpoint to avoid transfer acceleration fees. For more information, see Endpoints. API access to acceleration endpoints is supported only over HTTP or HTTPS. Other protocols such as Kafka and gRPC are not supported./** * In this example, the AccessKey ID and AccessKey secret are obtained from environment variables. */ String accessId = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"); String accessKey = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); /** * The Simple Log Service endpoint. Specify an acceleration endpoint. */ String endpoint = "log-global.aliyuncs.com"; /** * Create a Simple Log Service client. */ static Client client = new Client(host, accessId, accessKey);
What to do next
Configure the transfer acceleration feature when you use other collection methods
Replace ${Endpoint}
or ${host}
in your collection configuration with log-global.aliyuncs.com
to accelerate log collection.
Test network connectivity
Run the following command to test the network connectivity of transfer acceleration. The transfer acceleration feature takes effect only for projects for which the transfer acceleration feature is enabled.
curl ${your-project}.log-global.aliyuncs.com
If the following result is returned, the network connection is normal.
{"Error":{"Code":"OLSInvalidMethod","Message":"The script name is invalid : /","RequestId":"XXXXXXXXXXXXXXXXXXX"}}
Disable the transfer acceleration feature
Before you disable the transfer acceleration feature, make sure that you no longer use the acceleration endpoint to upload or download data.
Log on to the Simple Log Service console.
In the Projects section, click the project that you want to manage.
On the Project Overview page of the project, click Delete next to Acceleration Endpoint.
In the Confirm dialog box, click Modify.