Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP]2024-12-25 10:55:40 - |WARNING| - [tb_device_mqtt.py] - tb_device_mqtt - _wait_for_rate_limit_released - 749 - Rate limit reached for 1 seconds, waiting for rate limit to be released... #1635

Open
DuXiaoChuang opened this issue Dec 25, 2024 · 7 comments
Assignees
Labels
can be closed If bug fixed or feature is implemented help wanted

Comments

@DuXiaoChuang
Copy link

2024-12-25 10:55:40 - |WARNING| - [tb_device_mqtt.py] - tb_device_mqtt - _wait_for_rate_limit_released - 749 - Rate limit reached for 1 seconds, waiting for rate limit to be released...

How should this problem be solved?

@imbeacon
Copy link
Member

imbeacon commented Jan 6, 2025

Hi @DuXiaoChuang,

It is a warning, it may appear during initial configuration retrieving process, before the gateway received rate limits from server. If it appears only on starting - it is fine, but if it appears continuously - please provide more information about your environment, more logs, maybe configurations and how much data you try to send to server and how often.

@DuXiaoChuang
Copy link
Author

Hi @DuXiaoChuang,

It is a warning, it may appear during initial configuration retrieving process, before the gateway received rate limits from server. If it appears only on starting - it is fine, but if it appears continuously - please provide more information about your environment, more logs, maybe configurations and how much data you try to send to server and how often.

It happens once a second, and here's what happens

{
'deviceName': '沈阳机床T5-500Q',
'deviceType': 'default',
'telemetry': [{
'刀组数': 0
},
{
'每组刀具数': 0
},
{
'当前刀组号': 0
},
{
'当前刀具索引号': 0
},
{
'总报警数': 5
},
{
'报警类型': 0
},
{
'报警号': 0
},
{
'最后一条报警记录的编号': -16669
},
{
'报警内容': '\x00\x00\x00\x00\x00\x00\x00\x00'
},
{
'报警时间': 0
},
{
'绝对坐标X': -1.3046000003814697
},
{
'绝对坐标Z': 0.8700000047683716
},
{
'绝对坐标A': 0.0
},
{
'绝对坐标B': -0.0009500000160187483
},
{
'绝对坐标C': 0.0
},
{
'相对坐标值': -1.912109375
},
{
'进给实际速度': 0.0
},
{
'进给倍率': 100.0
},
{
'机械坐标X': -1.3178000450134277
},
{
'机械坐标Z': 0.9014999866485596
},
{
'机械坐标A': 0.0
},
{
'机械坐标B': -0.0009500000160187483
},
{
'机械坐标C': 0.0
},
{
'当前刀具号': 6
},
{
'当前刀偏号': 10
},
{
'加工件数': 1249
},
{
'运行时间': 2272
},
{
'切削时间': 0
},
{
'进给编程速度': 100.0
},
{
'主轴倍率': 100.0
},
{
'快速倍率': 100.0
},
{
'手动倍率': 100.0
},
{
'手轮倍率': 0.0
},
{
'CNC工作方式': 4
},
{
'CNC工作状态': 0
},
{
'当前运行的程序号': 0
},
{
'当前程序段号': 0
},
{
'手动速度': 0.0
},
{
'诊断号': 0
},
{
'诊断轴号': 0
},
{
'诊断值': 0
},
{
'诊断值类型': 1
}],
'attributes': [{
'CNC型号': 'K988TA\x00\x00\x00\x00'
},
{
'有效轴数': 5
},
{
'上电次数': 692
},
{
'机床编号': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
},
{
'轴伺服信息': 'GR'
},
{
'主轴伺服信息': 'GR'
}]
}

@DuXiaoChuang
Copy link
Author

Hi @DuXiaoChuang,

It is a warning, it may appear during initial configuration retrieving process, before the gateway received rate limits from server. If it appears only on starting - it is fine, but if it appears continuously - please provide more information about your environment, more logs, maybe configurations and how much data you try to send to server and how often.

As soon as I set the sendDataOnlyOnChange parameter to false, the alarm _wait_for_rate_limit_released - appears

{
"master": {
"slaves": [
{
"host": "192.168.1.4",
"port": 502,
"type": "tcp",
"method": "socket",
"timeout": 35,
"byteOrder": "BIG",
"wordOrder": "LITTLE",
"retries": true,
"retryOnEmpty": true,
"retryOnInvalid": true,
"pollPeriod": 1000,
"unitId": 1,
"deviceName": "\u6c88\u9633\u673a\u5e8aT5-500Q",
"sendDataOnlyOnChange": false,
"connectAttemptTimeMs": 5000,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 300000,
"attributes": [
{
"tag": "CNC\u578b\u53f7",
"type": "string",
"functionCode": 3,
"objectsCount": 5,
"address": 63001
},
{
"tag": "\u6709\u6548\u8f74\u6570",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 63013
},
{
"tag": "\u4e0a\u7535\u6b21\u6570",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 63030
},
{
"tag": "\u673a\u5e8a\u7f16\u53f7",
"type": "string",
"functionCode": 3,
"objectsCount": 5,
"address": 63060
},
{
"tag": "\u8f74\u4f3a\u670d\u4fe1\u606f",
"type": "string",
"functionCode": 3,
"objectsCount": 1,
"address": 63100
},
{
"tag": "\u4e3b\u8f74\u4f3a\u670d\u4fe1\u606f",
"type": "string",
"functionCode": 3,
"objectsCount": 1,
"address": 63500
}
],
"timeseries": [
{
"tag": "\u5200\u7ec4\u6570",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 59700
},
{
"tag": "\u6bcf\u7ec4\u5200\u5177\u6570",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 59702
},
{
"tag": "\u5f53\u524d\u5200\u7ec4\u53f7",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 59704
},
{
"tag": "\u5f53\u524d\u5200\u5177\u7d22\u5f15\u53f7",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 59706
},
{
"tag": "\u603b\u62a5\u8b66\u6570",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 62000
},
{
"tag": "\u62a5\u8b66\u7c7b\u578b",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 64502
},
{
"tag": "\u62a5\u8b66\u53f7",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 64503
},
{
"tag": "\u6700\u540e\u4e00\u6761\u62a5\u8b66\u8bb0\u5f55\u7684\u7f16\u53f7",
"type": "int",
"functionCode": 3,
"objectsCount": 1,
"address": 62004
},
{
"tag": "\u62a5\u8b66\u5185\u5bb9",
"type": "string",
"functionCode": 3,
"objectsCount": 4,
"address": 64507
},
{
"tag": "\u62a5\u8b66\u65f6\u95f4",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 64505
},
{
"tag": "Absolute X",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62100
},
{
"tag": "Absolute Z",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62102
},
{
"tag": "Absolute A",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62104
},
{
"tag": "Absolute B",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62106
},
{
"tag": "Absolute C",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62108
},
{
"tag": "\u76f8\u5bf9\u5750\u6807\u503c",
"type": "16float",
"functionCode": 3,
"objectsCount": 1,
"address": 62151
},
{
"tag": "Actual speed of feed",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62370
},
{"tag": "Feed rate",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62372
},
{
"tag": "Mechanical X",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62200
},
{
"tag": "Mechanical Z",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62202
},
{
"tag": "Mechanical A",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62204
},
{
"tag": "Mechanical B",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62206
},
{
"tag": "Mechanical C",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62208
},
{
"tag": "\u5f53\u524d\u5200\u5177\u53f7",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 62360
},
{
"tag": "\u5f53\u524d\u5200\u504f\u53f7",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 62361
},
{
"tag": "\u52a0\u5de5\u4ef6\u6570",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62362
},
{
"tag": "\u8fd0\u884c\u65f6\u95f4",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62364
},
{
"tag": "\u5207\u524a\u65f6\u95f4",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62366
},
{
"tag": "\u8fdb\u7ed9\u7f16\u7a0b\u901f\u5ea6",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62368
},
{
"tag": "\u8fdb\u7ed9\u5b9e\u9645\u901f\u5ea6",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62370
},
{
"tag": "\u8fdb\u7ed9\u500d\u7387",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62372
},
{
"tag": "\u4e3b\u8f74\u500d\u7387",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62395
},
{
"tag": "\u5feb\u901f\u500d\u7387",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62400
},
{
"tag": "\u624b\u52a8\u500d\u7387",
"type": "float",
"functionCode": 3,
"objectsCount": 2,
"address": 62402
},
{
"tag": "\u624b\u8f6e\u500d\u7387",
"type": "16float",
"functionCode": 3,
"objectsCount": 1,
"address": 62404
},
{
"tag": "CNC\u5de5\u4f5c\u65b9\u5f0f",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62406
},
{
"tag": "CNC\u5de5\u4f5c\u72b6\u6001",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62408
},
{
"tag": "\u5f53\u524d\u8fd0\u884c\u7684\u7a0b\u5e8f\u53f7",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62410
},
{
"tag": "\u5f53\u524d\u7a0b\u5e8f\u6bb5\u53f7",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62412
},
{
"tag": "\u624b\u52a8\u901f\u5ea6",
"type": "16float",
"functionCode": 3,
"objectsCount": 1,
"address": 62414
},
{
"tag": "\u8bca\u65ad\u53f7",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 65011
},
{
"tag": "\u8bca\u65ad\u8f74\u53f7",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 65012
},
{
"tag": "\u8bca\u65ad\u503c",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 65013
},
{
"tag": "\u8bca\u65ad\u503c\u7c7b\u578b",
"type": "16int",
"functionCode": 3,
"objectsCount": 1,
"address": 65016
}
],
"attributeUpdates": [
{
"tag": "shared_attribute_write",
"type": "32int",
"functionCode": 3,
"objectsCount": 2,
"address": 62415
}
],
"rpc": [
{
"tag": "setValue",
"type": "bits",
"functionCode": 5,
"objectsCount": 1,
"address": 31
},
{
"tag": "getValue",
"type": "bits",
"functionCode": 1,
"objectsCount": 1,
"address": 31
},
{
"tag": "setCPUFanSpeed",
"type": "32int",
"functionCode": 16,
"objectsCount": 2,
"address": 33
},
{
"tag": "getCPULoad",
"type": "32int",
"functionCode": 4,
"objectsCount": 2,
"address": 35
}
]
}
]
},
"id": "2c37dd3c-d968-4623-af70-b7c4b5b34a05",
"logLevel": "INFO",
"name": "modbus",
"enableRemoteLogging": false
}

@imbeacon
Copy link
Member

imbeacon commented Jan 7, 2025

As we can see - you have 50 configured datapoints, that should be polled each second, but it looks like it is not enough rate limits to send your data (You can read about rate limits for thingsboard.cloud - here).

The gateway uses 80% of available rate limits, to have ability to get incoming RPC requests and shared attribute updates.
So the reason of such behaviour is data that gateway stores in it’s storage. - When the gateway reads data from it - there are probably more than 1 message, with 50 datapoints, it tries to send it and then the client discovers that rate limit will be exceeded in case of sending and client waits before sending next batch of the data to ThingsBoard.

@DuXiaoChuang
Copy link
Author

As we can see - you have 50 configured datapoints, that should be polled each second, but it looks like it is not enough rate limits to send your data (You can read about rate limits for thingsboard.cloud - here).

The gateway uses 80% of available rate limits, to have ability to get incoming RPC requests and shared attribute updates. So the reason of such behaviour is data that gateway stores in it’s storage. - When the gateway reads data from it - there are probably more than 1 message, with 50 datapoints, it tries to send it and then the client discovers that rate limit will be exceeded in case of sending and client waits before sending next batch of the data to ThingsBoard.

what should i do to reslove this problem??

@imbeacon
Copy link
Member

imbeacon commented Jan 7, 2025

It looks like it is not enough rate limits for your gateway, what subscription type do you have on the cloud?

I see 2 possible solutions:

  1. Increase level of subscription.
  2. Install locally instance of ThingsBoard, without any limitations.

Also, it may be a some kind of gateway issue, if your subscription have enough rate limits, but to be sure, we need to know what type of subscription you use.

@DuXiaoChuang
Copy link
Author

DuXiaoChuang commented Jan 7, 2025 via email

@imbeacon imbeacon added the can be closed If bug fixed or feature is implemented label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be closed If bug fixed or feature is implemented help wanted
Projects
None yet
Development

No branches or pull requests

3 participants