Performance Issue with Sync and Async Serial Clients with PyModbus 3.8.3 #2561
-
First of all, thank you for maintaining this awesome library! I'm curious if the performance issue between the sync and async serial clients still persists to 3.8.3. I'm reading a battery charger which speaks Modbus and since I'm basing my program off the contributed solar.py example, I'm making around 125-150 separate register calls. That all takes about 12 seconds with the sync client. Based on the documentation, if I'm using the async client, this should be much faster, but I've encountered that the performance is about the same, and actually a bit worse if I'm using the async client. Is that expected? Also, out of curiosity, I've ran the performance.py with the same charger and the result (reading 10 registers with 1, 10, 100, and 1000 loops) between the clients were the same, with the async again performing slightly worse. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Please add a debug log as pr issue template, your problem is likely that your device does not respond and thus pymodbus tries to reconnect. |
Beta Was this translation helpful? Give feedback.
-
The solar.py example is a user contribution and as far as I know have not been updated for a long time. |
Beta Was this translation helpful? Give feedback.
-
As you can see from the log:
A read where your devices responds takes 95ms, which is the part that pymodbus do not control (you do partly with bps configuration). Second read is interesting:
beacuse data is split, which must be due to your rs485 converter, because your device sends the message in one go. Anyhow response is still 92 ms. I really cannot see any delay in pymodbus handling, the delay is in the line, your rs485 converter or your device. |
Beta Was this translation helpful? Give feedback.
As you can see from the log:
A read where your devices responds takes 95ms, which is the part that pymodbus do not control (you do partly with bps configuration).
Second read is interesting: