EdgeRoutine (ER) is a serverless computing service that runs JavaScript code on Alibaba Cloud's global points of presence (POPs). It supports ES6 syntax and standard Web Service Worker APIs. Requests execute on the POP nearest to each user, delivering ultra-low latency responses.
ER on Alibaba Cloud DCDN will no longer be available to new users at 00:00 (UTC+8) on May 1, 2025. Existing users will not be affected.
For this functionality, upgrade to ESA and use the ESA Functions and Pages feature.
Benefits
Global deployment and ultra-low latency: Unlike Function Compute or Elastic Compute Service (ECS), ER does not require region-specific deployment. It runs on a global POP network. Client requests route to the nearest POP, which executes your code and responds directly, minimizing latency.
Automatic scaling and pay-as-you-go billing: Alibaba Cloud's 3,200+ POPs provide built-in elasticity — surging requests automatically route to nearby POPs with available capacity. ER uses pay-as-you-go billing based on invocation count. You pay only while your code runs.
Serverless and easy to use: Focus on business logic without managing infrastructure (CPUs, memory, networking, or OS). Deploy by uploading code through the console or calling an API. The serverless model reduces development and O&M costs.
How it works
Request flow for /DCDN without ER: 1. Client sends a request to the POP gateway. → 2. POP checks its cache. On a cache hit, content returns to the client. → 3. On a cache miss, the request forwards to the origin server.
Request flow for /DCDN with ER: 1. Client sends a request to the POP gateway. → 4. ER intercepts the request and executes your JavaScript code. → Your code can use
fetchto access the cache, retrieve content from the origin server (Arrow 5 or 3), or call other public web services (Arrow 6).NoteER executes after the gateway, so your/DCDN domain name console configurations — HTTPS, access control, performance optimization, and cache rules — remain in effect.
Key concepts
Function: A Routine is a JavaScript runtime on a POP that runs your uploaded code. To use ER, create a Routine first. Each Routine has two parts: configurations (name, description, CPU/memory specs, and domain name allowlist) and your JavaScript code.
Version: Routines support version management. Snapshot your code as a version at any time during development. Publishing a Routine requires selecting a specific version to deploy. You can roll back to previous versions and manage code history. Each version gets a system-generated version number.
Environment: ER provides staging, production, and canary environments for development, testing, and deployment.
Staging environment: An independent edge node for testing your code. It simulates production but is fully isolated — changes here do not affect production. Access it by adding the provided staging IP to your
hostsfile.Production environment: The live environment, consisting of globally distributed POPs. After testing in staging, publish your code to production. ER automatically scales nodes based on request volume; actual regional distribution may vary.
Canary environment: Deploying directly to production risks affecting all users if errors exist. Use canary releases to gradually expand deployment scope. Canary environment (optional).
Domain Name: After creating and publishing a Routine, you need a domain name as the client entry point. ER supports only accelerated domain names from Alibaba Cloud or DCDN as entry points. Associate your Routine with an accelerated domain name in the or DCDN console.
Point of presence (POP): "Edge" refers to distributed deployment, as opposed to centralized. A POP is a/DCDN node closest to the client that processes incoming requests.
Limitations
Item | Limit | Description |
CPU time | 5 ms, 50 ms, or 100 ms | CPU time per ER execution (excludes I/O wait). Choose from 5 ms, 50 ms, or 100 ms specifications. Billing. |
Memory | 128 MB | Total memory per domain name on a single physical machine. All requests for that domain name on the machine share this pool. |
Execution time (RT) | 120s | Maximum total response time per ER execution, including I/O wait. |
Wait time | 10 seconds | Maximum time the gateway waits for an ER response. If no data returns within 10 seconds, the gateway terminates the connection and returns a 504 status code. |
Code package size | 4 MB | Maximum JavaScript code file size per Routine. |
Number of subrequests | 4 | Maximum |
Programming language | JavaScript (ES6 syntax) | Only JavaScript is supported. You must have JavaScript programming knowledge. |
Number of Routines | 50 | Maximum Routines per Alibaba Cloud account. |
Number of versions | 10 | Maximum versions per Routine. |
Supported protocols | HTTPS only | WebSocket, TCP, and UDP are not supported. |
Nested subrequests | Not supported | An ER instance cannot |