When searching or indexing, you might run into an error stating:
Drupal\search_api_solr\SearchApiSolrException: Solr endpoint [url] unreachable or returned unexpected response code (429). The Acquia Search flood control mechanism has blocked a Solr query due to API usage limits. or Flood protection has blocked request of type select.
This is due to the default flood control limitations that come pre-shipped with Acquia Search. Fortunately those configurations can be changed.
Overriding these limits to high values may cause your application's Search usage to exceed your contractual limits. If this happens, you may contacted by our Account Management/Sales team to discuss an entitlement and billing increase, or in extreme cases, your shared Search endpoints may be temporarily disabled to keep platform integrity. See our Acquia Search Product Guide: Entitlements and Acquia Search Documentation: Staying under limits pages or more information.
Depending on the scenario where you encounter this error, you might want to tackle this issue in different ways.
The "catch-all" way of dealing with this issue would be to increase those flood control limit values. However, there is a different configuration for each type of query. That means that Solr /select queries can have a different value with regards to flood control limits compared to Solr /update queries.
If you are running into the error while searching, then you would want to increase the /select limit as such, "100" being an example value
drush --uri=www.example.com cset acquia_search.settings flood_limit.select.limit 100
If after you change the limit you want to verify the limit you need to change it from cset in the command to cget.
drush --uri=www.example.com cget acquia_search.settings flood_limit.select.limit
If on the other hand you are running into the error while indexing, you could either increase the flood control limit for update requests - again "600" is an example value
drush --uri=www.example.com cset acquia_search.settings flood_limit.update.limit 600
Also, for the indexing scenario, you could also increase the amount of entities processed in each batch, thus making the requests less frequent but with a larger data payload. Doing this might then not require to additionally tweak the flood control limitation. To achieve this, use drush to index and provide a larger --batch-size argument:
# Index in batches of 250. Note: if you run out of memory, use smaller batches. drush --uri=www.example.com search-api:index --batch-size=250
See our Acquia Search Documentation: Staying under limits document page.