5

これは難しい質問ですが、とにかくやってみます。私たちの仕事は、Microsoft FAST ESP にギガバイトのデータを供給することです。インデックス化されたデータの最終的な量は、50 ~ 60 GB 程度です。

FAST には .NET API がありますが、コア コンポーネントは Python で記述されています (パイプラインを処理してドキュメントにインデックスを付けます)。課題は、インデックス作成のためにギガバイトのデータをシステムに供給しながら、システムと確実に通信することです。

ここで FAST で発生する問題は次のとおりです。

  1. 一度に大量のデータが供給されると、システムが何時間もアクセスできないままデータのインデックスを再作成する必要があるため、システムは風変わりです。受け入れられない。

  2. これには時間がかかりすぎる (数日) ため、すべてのデータをキューに入れ、一度に 1 つのアイテムを連続してフィードするオプションはありません。

  3. FAST でアイテムをインデックス化できない場合、クライアントはアイテムを再フィードする必要があります。これが機能するためには、システムがコールバック メソッドを呼び出して、クライアントに失敗を通知する必要があります。ただし、システムがタイムアウトするたびに、そのコールバックが呼び出されないため、フィード クライアントはタイムアウトに対応できません。したがって、クライアントは飢えています。データはキューにありますが、システムに渡すことができません。キューが崩壊します。データが失われます。あなたはアイデアを得る。

ノート:

  1. 小さなアイテムの場合は数秒、大きなアイテムの場合は最大 5 ~ 8 時間かかります。
  2. インデックスが作成されるアイテムは、バイナリ ベースとテキスト ベースの両方です。
  3. 目標は、完全なインデックス作成に「わずか」48 ~ 72 時間かかることです。つまり、週末に実行する必要があります。
  4. ここでの FAST ドキュメント処理パイプライン (Python コード) には、それぞれ約 30 のステージがあります。この記事の執筆時点では、合計 27 のパイプラインがあります。

要約すれば:

主な課題は、大小の項目を適切な速度でシステムに供給することです (システムが崩壊したり、メモリの問題が発生したりする可能性があるため、速すぎたり、時間がかかりすぎるため遅すぎたりすることはありません)、同時に、並行して実行します。スレッドを非同期に実行するような方法。私の意見では、どのアイテムをいつ、何個同時に給餌するかを決定するアルゴリズムが必要です。並列プログラミングが思い浮かびます。

各キュー (プロセス) が特定のサイズのアイテム専用である複数の「キュー」が存在する場合もあります。これらのアイテムはキューにロードされ、1 つずつ (ワーカー スレッドで) 供給されます。

誰かがこのようなことをしたことがあるかどうか、またはこのような問題にどのように対処するかについて興味があります.

編集: 繰り返しますが、私は FAST ESP を「修正」したり、内部の仕組みを改善したりするつもりはありません。有効活用にチャレンジ!

4

4 に答える 4

1

まず、このような問題にはタスクを使用する必要があります。
それらは、同期、非同期、スレッドプールなどで開始でき、スレッドロックを備えたモデルよりもはるかに安価にメモリを使用できます。

Task.ContinueWithはあなたの問題に完全に適合すると思います。

アルゴリズムは次のようになります。

  1. パブリッシュする必要があるデータを含むキューを収集します。
  2. キューからより重いオブジェクト(および反対側から最小のオブジェクト)を取得するタスク(またはリスクがある場合はタスク:)を開始し、アップロードを開始します。
  3. アップロードを終了するメソッドを作成します。これにより、新しいキュー アイテムの新しいタスクが開始されます。
  4. タイムアウトにはキャンセル トークンを使用できます。
  5. システムがエラーを取得するアイテムを定義できるたびに。
于 2011-09-06T11:59:01.277 に答える
1

It sounds like you're working with a set of issues more than a specific C# feeding speed issue.

A few questions up front - is this 60gb data to be consumed every weekend or is it an initial backfill of the system ? Does the data exist as items on the filesystem local to the ESP install or elseware ? Is this a single internal ESP deployment or a solution you're looking to replicate in multiple places ? Single node install or multiple (or rather ... how many - single node cap is 20 docprocs) ?

ESP performance is usually limited by number of documents to be handled more than the number of files. Assuming your data ranges between email size 35k data and filesystem size 350k data you 60gb equates to between 180k docs and 1.8mil docs, so to feed that over 48hrs you need to feed between 3750 and 37500 documents per hour. Not a very high target on modern hardware (if you installed this on a VM ... well... all bets are off, it'd be better off on a laptop).

For feeding you have a choice between faster coding & more control with either managing the batches fed yourself or using the DocumentFeeder framework in the api which abstracts a lot of the batch logic. If you're just going for 37.5k docs/hr I'd save the overhead and just use DocumentFeeder - though take care in its config params. Document feeder will allow you to treat your content on a per document basis instead of creating the batches yourself, it will also allow for some measure of automatically retrying based on config. General target should be for a max of 50mb content per batch or 100 docs, whichever comes first. Larger docs should be sent in smaller batches... so if you have a 50mb file, it should ideally be sent by itself, etc. You'd actually lose the control of the batches formed by document feeder... so the logic there is kinda a best effort on the part of your code.

Use the callbacks to monitor how well the content is making it into the system. Set limits on how many documents have been fed that you haven't received the final callbacks for yet. Target should be for X batches to be submitted at any given time -or- Y Mb, pause at either cutoff. X should be about 20 + # of document processors, Y should be in the area of 500-1000Mb. With document feeder it's just a pass/fail per doc, with the traditional system it's more detailed. Only wait for the 'secured' callback ... that tells you it's been processed & will be indexed... waiting for it to be searchable is pointless.

Set some limits on your content... in general ESP will break down with very large files, there's a hard limit at 2gb since it's still 32bit procs, but in reality anything over 50mb should only have the metadata fed in. Also... avoid feeding log data, it'll crush the internal structures, killing perf if not erroring out. Things can be done in the pipeline to modify what's searchable to ease the pain of some log data.

Also need to make sure your index is configured to well, at least 6 partitions with a focus on keeping the lower order ones fairly empty. Hard to go into the details of that one without knowing more about the deployment. The pipeline config can have a big impact as well... no document should ever take 5-8 hours. Make sure to replace any searchexport or htmlexport stages being used with custom instances with a sane timeout (30-60 sec) - default is no timeout.

Last point... odds are that no matter how your feeding is configured, the pipeline will error out on some documents. You'll need to be prepared to either accept that or refeed just the metadata (there are other options, but kinda outside the scope here).

good luck.

于 2011-09-10T06:48:54.807 に答える
0

データベースで直接 BULK INSERT を使用できますか? そうでない場合は、サードパーティ製品のプロバイダーと協力して、実行可能なソリューションを策定できるようにすることをお勧めします.

于 2011-09-06T12:01:57.747 に答える
0

あなたが説明したデータベースは使用できません。いくつかの回避策を見つけることができますが、将来同様の大きな問題に遭遇するでしょう。転送に 1 日かかる ~10GB とランダムな再インデックス付けはばかげているように聞こえます。

私のアドバイスは、プロバイダーにデータベースを使用可能な状態にする (バグを修正する) よう要求するか、データ抽出を提供して独自のデータベースを作成することです。

于 2011-09-06T12:32:13.953 に答える