Random high connection latency when searching during high write activity

ES version: 7.17.20

While a separate process is performing writes on an index, I'm observing wildly varying connection latency when performing a search on the index. A search (performed via cURL) on the index took 140 seconds, then 40 minutes later the same search completed almost instantly. When I was trying the search via the Python client, I was getting this error unless I set the Elasticsearch client's timeout to several minutes or more: elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='elasticsearch-master', port=9200): Read timed out. (read timeout=60))

What could account for the wildly varying connection latency when searching this index?