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

[BUG] High CPU usage without any active connector #1678

Open
nightcore500 opened this issue Feb 14, 2025 · 0 comments
Open

[BUG] High CPU usage without any active connector #1678

nightcore500 opened this issue Feb 14, 2025 · 0 comments
Assignees
Labels

Comments

@nightcore500
Copy link

nightcore500 commented Feb 14, 2025

I am observing an issue with a freshly set up ThingsBoard Gateway (3.7.0) running in an LXC container with Debian 12.9 & Python 3.11.2.
The gateway is currently only connected to ThingsBoard. No connectors are active at the moment.
Nevertheless, the Python process is causing 100% CPU load:

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                    
   4995 thingsb+  20   0 1129920  57600  13440 S 100.7   2.7   6:08.44 python3
Feb 14 10:56:39 srv-tbiotgateway systemd[1]: Started thingsboard-gateway.service - ThingsBoard Gateway.
Feb 14 10:56:39 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:39 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 188 - Gateway starting...
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 199 - ThingsBoard IoT gateway version: 3.7.0
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - _load_connectors - 976 - Connectors - not found, waiting for remote configuration.
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_client.py] - tb_client - connect - 376 - Connecting to ThingsBoard...
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_client.py] - tb_client - __send_connect - 403 - Sending connect to 10.30.2.211:1883, tls: False...
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |WARNING| - [tb_client.py] - tb_client - connect - 387 - Cannot use TLS connection on this port. Client will try to connect without TLS.
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_client.py] - tb_client - __send_connect - 403 - Sending connect to 10.30.2.211:1883, tls: False...
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_client.py] - tb_client - __send_connect - 406 - Connect msg sent to platform.
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_device_mqtt.py] - tb_device_mqtt - _on_connect - 436 - MQTT client <paho.mqtt.client.Client object at 0x7f0a2bfa0fd0> - Connected!
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_device_mqtt.py] - tb_device_mqtt - on_service_configuration - 738 - Service configuration was successfully retrieved and applied.
Feb 14 10:56:40 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:40 - |INFO| - [tb_device_mqtt.py] - tb_device_mqtt - on_service_configuration - 739 - Current limits: {'rateLimits': {'messages': None, 'telemetryMessages': None, 'telemetryDataPoints': None}, 'maxPayloadSize': 65536, 'maxInflightMessages': 100}
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 270 - Gateway core started.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_mqtt.py] - tb_gateway_mqtt - gw_subscribe_to_attribute - 255 - Subscribed to *|* with id 1 for device *
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - __init__ - 83 - Remote Configurator started
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - _load_connectors - 976 - Connectors - not found, waiting for remote configuration.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __process_remote_logging_update - 702 - Remote logging level set to: INFO
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 287 - Gateway connectors initialized.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 291 - Persistent devices loaded.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _process_config_request - 246 - Configuration update request received.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [tb_gateway_service.py] - tb_gateway_service - __init__ - 315 - Gateway started.
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |ERROR| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - _handle_logs_configuration_update - 447 - Cannot create handler databaseHandler with [Errno 2] No such file or directory: './logs/database.log' error. Skipping...
Feb 14 10:56:41 srv-tbiotgateway python3[5111]: 2025-02-14 10:56:41 - |INFO| - [statistics_service.py] - statistics_service - __send_statistics - 207 - Collected regular statistics: {'machineStats': {'totalCpuUsage': 81.98, 'diskUsage': 6.3, 'freeMemory': 3.8, 'freeDisk': '7.5G', 'gwProcessCpuUsage': 25.4, 'gwMemory': 2.7, 'gwProcessMemoryFullInfo': {'rss': 58589184, 'vms': 1157046272, 'shared': 13762560, 'text': 2838528, 'lib': 0, 'data': 174149632, 'dirty': 0, 'uss': 54829056, 'pss': 55899136, 'swap': 3.8, 'freeDisk': '7.5G', 'gwProcessCpuUsage': 25.4, 'gwMemory': 2.7, 'gwProcessMemoryFullInfo': {'rss': 58589184, 'vms': 1157046272, 'shared': 13762560, 'text': 2838528, 'lib': 0, 'data': 174149632, 'dirty': 0, 'uss': 54829056, 'pss': 55899136, 'swap': 0}, 'msgsSentToPlatform': 12, 'msgsReceivedFromPlatform': 1}, 'serviceStats': {'storageMsgPulled': 0, 'storageMsgCount': 0, 'platformMsgPushed': 0, 'platformAttrProduced': 0, 'platformTsProduced': 0}, 'connectorsStats': {}}


Configuration:

{
"thingsboard": {
"host": "10.30.2.211",
"port": 1883,
"remoteShell": false,
"remoteConfiguration": true,
"statistics": {
"enable": true,
"statsSendPeriodInSeconds": 3600
},
"deviceFiltering": {
"enable": false,
"filterFile": "list.json"
},
"maxPayloadSizeBytes": 1024,
"minPackSendDelayMS": 200,
"minPackSizeToSend": 500,
"checkConnectorsConfigurationInSeconds": 60,
"handleDeviceRenaming": true,
"security": {
"type": "accessToken",
"accessToken": "xxxxxxxx"
},
"qos": 1,
"checkingDeviceActivity": {
"checkDeviceInactivity": false,
"inactivityTimeoutSeconds": 200,
"inactivityCheckPeriodSeconds": 500
},
"reportStrategy": {
"type": "ON_REPORT_PERIOD",
"reportPeriod": 60000
},
"ts": 1739528697176
},
"storage": {
"type": "memory",
"read_records_count": 100,
"max_records_count": 100000,
"data_folder_path": "./data/",
"max_file_count": 10,
"max_read_records_count": 10,
"max_records_per_file": 10000,
"data_file_path": "./data/data.db",
"messages_ttl_check_in_hours": 1,
"messages_ttl_in_days": 7,
"ts": 1739528697176
},
"grpc": {
"enabled": false,
"serverPort": 9595,
"keepaliveTimeMs": 10000,
"keepaliveTimeoutMs": 5000,
"keepalivePermitWithoutCalls": true,
"maxPingsWithoutData": 0,
"minTimeBetweenPingsMs": 10000,
"minPingIntervalWithoutDataMs": 5000,
"keepAliveTimeMs": 10000,
"keepAliveTimeoutMs": 5000
},
"connectors": []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants