How to debug [homeassistant.components.websocket_api.http.connection] errors

I keep getting these [homeassistant.components.websocket_api.http.connection] errors at the rate of about 100 per day:

2019-11-12 21:16:55 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1826670608] Client exceeded max pending messages [2]: 512
2019-11-12 21:16:55 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1826670608] Connection closed by client
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Client exceeded max pending messages [2]: 512
2019-11-12 21:57:15 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1822849808] Connection closed by client
2019-11-12 22:06:46 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1829056272] Client exceeded max pending messages [2]: 512
2019-11-12 22:06:46 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1829056272] Connection closed by client
2019-11-12 22:17:13 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1816469904] Connection closed by client
2019-11-12 22:20:56 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1822369040] Client exceeded max pending messages [2]: 512
2019-11-12 22:20:56 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1822369040] Connection closed by client
2019-11-12 22:58:12 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1816955440] Connection closed by client
2019-11-12 23:06:24 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1802428176] Connection closed by client
2019-11-12 23:15:04 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1816314320] Client exceeded max pending messages [2]: 512
2019-11-12 23:15:04 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1816314320] Connection closed by client
2019-11-12 23:19:16 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1819042640] Connection closed by client
2019-11-12 23:25:00 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1823064944] Client exceeded max pending messages [2]: 512
2019-11-12 23:25:00 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1823064944] Connection closed by client
2019-11-13 07:12:20 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1827136784] Connection closed by client
2019-11-13 07:15:27 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1843024496] Connection closed by client
2019-11-13 07:21:30 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1821364752] Connection closed by client
2019-11-13 08:43:47 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1827136400] Connection closed by client
2019-11-13 08:44:03 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1826669392] Connection closed by client
2019-11-13 11:30:00 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1807985840] Connection closed by client
2019-11-13 11:34:06 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1827583280] Client exceeded max pending messages [2]: 512
2019-11-13 11:34:06 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1827583280] Connection closed by client

Other forum posts regarding the subject are inconclusive, so want to dig deeper and see what is causing this for my specific situation.

In my initial attempt to debug I am using this:

logger:
  default: error
  logs:
    homeassistant.components.websocket_api: info

but nothing points to a real culprit. Setting log level for homeassistant.components.websocket_api to debug creates an overwhelming soup of information in the log that I find hard to analyze.

Any suggestions?

Did you ever find a solution?

Would it be worth changing your debug to “critical” or “debug”:

logger:
  default: error
  logs:
    homeassistant.components.websocket_api: debug

I had an issue where I had created an automation in error and caused massive slowdown to the system. Maybe worth trying disabling Automation(s) and Components one by one?