The page uses echarts line chart, how to achieve real-time data refresh?

There is an echarts line chart on the

page, which is required to be refreshed every other minute.
what I"m doing now is to request data every other minute, push into an array of my line chart, and then refresh my line chart.
but this will put a heavy burden on the server, and there will be situations where real-time data is not requested and the line chart is disconnected.
I would like to ask you what good solutions do you have? Can refresh data in less time and solve the server burden.

Apr.21,2021

  1. improve server capacity
  2. use websocket

Polling- polling as you describe has an impact on server load

if you need to refresh ws communications in real time, (websocket) is a good choice

nodeJS-based Socket.IO can be used for compatibility

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36446-40589.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36446-40589.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?