epics-base / pvaPy

pvaPy provides Python bindings for EPICS pvAccess
https://epics.anl.gov/extensions/pvaPy/production/index.html
Other
36 stars 22 forks source link

Mirror server slow processing large struct arrays #75

Open echandler-anl opened 2 years ago

echandler-anl commented 2 years ago

Problem: PV servers has difficultly keeping up reading PV objects with very large struct arrays. The same issue appears with both mirror server and p2p. Steps to reproduce:

  1. IOC is writing PV array with 27000 struct elements to a PV channel at 10hz
  2. Run mirror server mapped to PV channel to a second PV channel
  3. Run pvapy client to read data from the second PV channel

The pvapy client receives the data at 4Hz. The TCP-rx thread in the mirror server is maxed out and the perf profile shows that it is spending most time creating and deleting struct arrays (see graph below):

image

Both the mirror server and pv client can be optimized by caching the PV object structure after the connection is initialized.