アイテムを大量に削除するとSolrサーバに高負荷がかかる


説明

多数のアイテムまたはアイテムのバージョンを削除すると、Solrサーバーに大量のリクエスト数が送信される場合があります。これは、バッチ モードが有効になっている場合でも発生する可能性があります。リクエスト数が高騰すると、Solrサーバーのパフォーマンスに影響を与え、次のようなエラーを引き起こすことがあります:

org.apache.solr.client.solrj.SolrServerException: Max requests queued per destination 3000 exceeded for HttpDestination[http://...]
java.io.IOException: Request processing has stalled for 119004ms with 100 remaining elements in the queue.

解決策

本問題を解決するには、以下のいずれかのオプションをご検討ください:

備考

ソリューションが、各Sitecore検索インデックスに個別のSolrコア/コレクションを使用するように構成されている場合(これがデフォルトの挙動です)、ContentSearch.Solr.RestrictDeleteByIndexNameの設定を無効にすることでさらなる最適化を実現できます。これを実施するには、この設定を無効にする設定パッチ ファイル\App_Config\Include\zzzフォルダに作成してください:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
  <sitecore search:require="solr">
    <settings>
      <setting name="ContentSearch.Solr.RestrictDeleteByIndexName" value="false" /> 
    </settings>
  </sitecore>
</configuration>

Solrサーバの負荷を軽減する方法に関する推奨事項につきましては、以下の記事をご参照ください:
https://doc.sitecore.com/xp/en/developers/latest/platform-administration-and-architecture/use-solr-soft-commits.html