Message and traffic statistics FAQ
IoT Edge is a free product. However, its usage generates messages and network traffic. This topic describes the MQTT messages and network traffic generated when you use IoT Edge.
- Message statistics: Refers to the MQTT messages on Alibaba Cloud IoT Platform. For more information about billing, see Message communication billing.
- Traffic statistics: The amount of network traffic consumed. This includes the data traffic used by an Internet Service Provider (ISP) network, such as a 2G, 3G, 4G, or LTE network.
MQTT heartbeats
MQTT heartbeats are not included in the message statistics of IoT Platform. They primarily contribute to traffic consumption.
| Data size of a single MQTT heartbeat packet | Reporting frequency | Average daily traffic | Monthly Average Traffic |
| 2 bytes | Every 120 seconds | 2 bytes × (24 × 60 × 60) seconds / 120 seconds = 1,440 bytes | 1,440 bytes/day × 30 days = 43.2 KB |
Edge instance deployment
Deploying an edge instance primarily consumes HTTP traffic when instance resources are downloaded. These resources include driver programs, device and driver configurations, Function Compute code, and product Thing Specification Language (TSL) models. This process does not generate continuous traffic.
The following table lists the sizes of official drivers. The sizes of other edge instance resources vary depending on your specific configuration.
| Official driver name | Size |
| Websocket driver (C) | 5 MB |
| Modbus driver (C) | 3.5 MB |
| Modbus driver (Python) | 49.9 KB |
| OPC UA driver (Python) | 17.7 KB |
Device property and event reporting, and service invocation
Reporting device properties and events or invoking device services generates traffic. The amount of traffic depends on factors such as the number of properties, reporting frequency, and number of invocations.
When you write a driver, note the following:
- Define the device's TSL model carefully. For example, consider the length of property identifiers and whether to merge or split properties.
- Set the reporting frequency for properties and events as needed.
- Determine whether to report all properties and events or only the updated ones, as needed.
- The identifiers of reported properties must be defined in the IoT Platform console. For more information about how to define properties in the console, see Add a TSL model for a single product.
- For long property values, select a suitable codec, such as Base64 or hexdump, and determine whether compression can be used.
You can calculate the traffic statistics for device property and event reporting, and service invocation as follows:
- Property reporting
Request message: /sys/$your_ProductKey/$your_DeviceName/thing/event/property/post {"id":"1945","version":"1.0","method":"thing.event.property.post","params":{"int32_rw":{"time":1565700807453,"value":0},"int32_r":{"time":1565700807453,"value":0},"float_rw":{"time":1565700807453,"value":0},"float_r":{"time":1565700807453,"value":0},"double_rw":{"time":1565700807453,"value":0},"double_r":{"time":1565700807453,"value":0},"enum_rw":{"time":1565700807453,"value":0},"enum_r":{"time":1565700807453,"value":0},"bool_rw":{"time":1565700807453,"value":0},"bool_r":{"time":1565700807453,"value":0},"string_rw":{"time":1565700807453,"value":""},"string_r":{"time":1565700807453,"value":"MlRVZq"},"date_rw":{"time":1565700807453,"value":""},"date_r":{"time":1565700807453,"value":"1565700807457"}}} Response message: /sys/$your_ProductKey/$your_DeviceName/thing/event/property/post_reply {"code":200,"data":{"date_rw":"6311:tsl parse: date type must be a string of long(UTC ms) -> date_rw"},"id":"1945","message":"success","method":"thing.event.property.post","version":"1.0"} - Event reporting
Request message: /sys/$your_ProductKey/$your_DeviceName/thing/event/event_int32/post {"params":{"time":1565700809121,"value":{"int32_rw":0}},"id":"1955","version":"1.0","method":"thing.event.event_int32.post"} Response message: /sys/$your_ProductKey/$your_DeviceName/thing/event/event_int32/post_reply {"code":200,"data":{},"id":"1955","message":"success","method":"thing.event.event_int32.post","version":"1.0"} - Service invocation
Request message: /sys/$your_ProductKey/$your_DeviceName/thing/service/property/set {"method":"thing.service.property.set","id":"1115850974","params":{"string_rw":"hello world"},"version":"1.0.0"} Response message: /sys/$your_ProductKey/$your_DeviceName/thing/service/property/set_reply {"id":"1115850974","code":200,"data":{}}
Monitoring information
In the console, you can enable monitoring information for the edge instance as needed. This feature is disabled by default. Monitoring data is uploaded over HTTP or HTTPS and does not generate MQTT messages.
Monitoring consumes a large amount of traffic. Enable this feature only when you use a Wi-Fi or wired network.
| Metric | Packet size per item (HTTP) | Reporting frequency | Average daily traffic | Average monthly traffic |
| Host monitoring | 12.04 KB | Every 15 seconds | 12.04 KB × (60 × 60 × 24) seconds / 15 seconds = 69,350 KB | 70 MB/day × 30 days = 2,100 MB |
| Scene orchestration (4 metrics) | 300 bytes | Every 60 seconds | 4 × 300 bytes × (60 × 60 × 24) seconds / 60 seconds = 1,728 KB | 1,728 KB/day × 30 days = 52 MB |
| Edge application (4 metrics) | 300 bytes | Reported every 60 seconds | 4 × 300 bytes × (60 × 60 × 24) seconds / 60 seconds = 1,728 KB | 1,728 KB/day × 30 days = 52 MB |
| Driver monitoring (4 metrics) | 300 bytes | Every 60 seconds | 4 × 300 bytes × (60 × 60 × 24) seconds / 60 seconds = 1,728 KB | 1,728 KB/day × 30 days = 52 MB |
| Data stream monitoring (4 metrics) | 300 bytes | Every 60 seconds | 4 × 300 bytes × (60 × 60 × 24) seconds / 60 seconds = 1,728 KB | 1,728 KB/day × 30 days = 52 MB |
Remote access
In the console, you can enable the remote access feature for the gateway as needed. This feature is disabled by default. Remote access does not generate MQTT messages. The traffic generated by maintaining heartbeats is approximately 3.5 MB per month.
After you enable remote access, operations such as running shell commands or uploading and downloading files consume traffic. Enable this feature only when you use a Wi-Fi or wired network.
| Packet size (WebSocket) | Reporting frequency | Average daily traffic | Average monthly traffic |
| ping-pong 20 bytes | Every 15 seconds | 20 bytes × (24 × 60 × 60) seconds / 15 seconds = 115,200 bytes | 115,200 bytes/day × 30 days = 3.5 MB |
Simple Log Service
In the console, you can enable Simple Log Service for the edge instance as needed. This service is disabled by default. Simple Log Service primarily consumes traffic when log content is uploaded over HTTP. The amount of traffic depends on the log level, log generation frequency, and log content length. Enable this service only when you use a Wi-Fi or wired network.
Simple Log Service does not generate MQTT messages.