はじめに
I work in a company where we run many batch jobs processing millions of records of data each day and I've been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn't it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I'm going to look at the potential benefits of employing an office grid using virtualised environments.
In Part 4 we looked at using tools to ensure that we're running the latest version of the code and data sources so that obtained results are always up-to-date with the latest business information and logic.
Pre-Deployment
Before deploying your grid system if there's one thing you do and one thing alone it's benchmark your current system ! No matter what you tell colleagues about how much extra work your system is going to do unless you have numbers to back this up your guarantees are nothing. だから、
- how many records can you process currently? あたりの日? Per Hour?
- How long does it typically take to turn around a job?
- How much more capacity do you have?
There's also additional questions:
- If your processing server (or one of your processing servers) goes down how will this affect your capabilities, will you be crippled?
- What advantages do you hope/expect to get from a grid system?
- Are your office machines capable of running the jobs?
- Are your (or can you jobs be converted) to wrok in this style of running?
The last major point is to take your time on any major change like this. Update your processing code to work using the new methodology, benchmark again. Possibly set up your processing server to run a virtual machine, after all your processing server will just be another worker (just a very powerful one relatively). Allow the new process to settle.
Deployment
My suggestion would be to pop into the office one weekend perform all the installations and setup. Do this just before a fortnight's holiday and leave so other poor chap to deal with the consequences… maybe not…
Deployment for a system like this needs to be slow. Despite it being relatively simple to set up this system will affect your entire office infrastructure (well the digital one). Firstly, roll out to a couple of machines at a time, monitor network traffic, how the worker hosts perform on a day-to-day basis. You may need to alter your job configuration in response to your findings.
Once the system has settled with a few machines (lets say 10% of all office machines, ie 5) keep monitoring network traffic and host machine performance. Next benchmark again, you should now be processing 33% more jobs than your first benchmarks. Check this is so, or that you're at least in this ballpark. If not, investigate what is going on before moving on. を繰り返して喜んで、すべてのオフィス機器は、個々のマシンのパフォーマンスを殺したり、停止するには、ネットワークを粉砕せずに実行するまで、このサイクルを。
At all times keep benchmarking, even after all deployments are made. Check how new code updates affect speed of your system, check all workers are reporting in and processing jobs. Slowly (very slowly) increment your job configuration to get the best from your workers and network.
ストップ!
どのようないくつかの時間で動作しているから労働者を停止したい場合は? 彼らはすべてのアウトが、再生、実行していると空腹昆虫のようにデータを処理するために最善をしようとしている。 答えは明らかにその価値が見過ごされ、念のために追加するかもしれません。 単に出口(0)または死ぬ()または処理ジョブを殺すためにいくつかの他のステートメントを使用して処理スクリプトを編集します。 重要な理由は、なぜ我々は常に実行する前に、最新の処理スクリプトを更新してみて!
デモンストレーションシステム
ために私は技術や方法論を示すために、非常に小さなグリッドを作成短い記事のセットを作成する。 私は、記事、チュートリアルの多くを読んで、セットアップに様々なツールを使用し、何が起こっているか監視します。 手段は私が行っていることで、トラフィックとオフィス全体を飽和も私は、ホストのパフォーマンスが影響を受けた方法を参照してください定期的に職員のPCへのアクセスがあった。
私のデモシステムは確かに非常に謙虚だった。 私は通常のデスクトップは、ジョブ制御サーバとして設定され使用されます。 これについて私がインストールされていたMySQLのレプリケーションでマスタとして設定されてインストールされているサーバーを、 PHPの 、ÂとSVNを介してリンクされているApacheの (VMの労働者を介してのアクセス)。
私は、6歳のWindows XPのラップトップ上のVirtualBoxでCentOSの労働者のマシンを作成しました。 マシンにVMをコピーし、それを手放すの後に指定するなどのタスクをスケジュール設定すれ。
仮想マシンは、PHP、転覆、およびMySQLで設定された。 私は、ジョブ制御サーバーのリポジトリーからの'労働者と確認したことは'svn update'を使用して更新できるという名前のブランチをチェックアウト。 次に私のセットアップスレーブとしてMySQLとのデータは、ジョブ制御サーバーを停止ワーカーVMへのMySQLから複製されたことを確認した。 すべてこれは私のセットアップのbashスクリプトとcronジョブの後。
私の処理スクリプトは、基本的に、この(非常に簡単なもの)の線に沿って行った:
- 名]フィールドに読む
- VM上で保持されているデータソースからテーブル内の類似した名前の数をカウント
- 上記のように名前の数を数え、スペース(すなわちforename、中間、姓)で名前を分割する
- 1,000回このプロセスを繰り返し
各ジョブの実行に約20分かかりました。 ある時点で私は窓のラップトップ上でワーカーVMの複数のコピーを開いて、ジョブが労働者のIPアドレスの各々によってオフにチェックすることが見ていた。 この時点で私はまた、レプリケーションが自動的に再起動を確認した。
ラップトップを残して、ジョブ制御サーバからのジョブの処理を開始労働者のような結果空費します。 When resuming laptop usage there was a delay of about 30-60 seconds, this is a fair amount of time and staff would need to be made aware that their machine may pause for a short while when returning to the machine. Newer machines may not have a pause of this long. The benefit of the amount of processing performed by these machines during idle periods would more that outweigh staff members having to wait a short period (say 1 minute) on arriving at their machines of a morning (I frequently wait longer that this for a Windows Defender update to take place) provided they were made aware of this (useful time to grab a morning coffee!).
Overall I feel confident that I have demonstrated the technologies that could be used to create such a system. I have shown that such a system does work on a (very) small scale and with some more experimenting could be scaled up utilise the resources of an office's machines. If I don't get to the point of doing this I would be very interested to know/see when someone else does.
結論/評価
次の明白な手順では、実際に現実世界での例を取得することです、オフィス環境の中でこのようなシステムを展開して、何が起こるか見て起動します。 技術を証明する証跡燃える会社と有効性をせずに、このことを約束し、事業をお願い少し難しいかもしれません。 グリッド/分散コンピューティングは、非常に普及しているいくつかの円であり、(BIONCは、SETI @ Homeは、折り畳みアットホームなど)いくつかの大規模なアプリケーションを持っています。 しかし私は、小規模、そのオフィス環境の中で展開されることができず、私の検索でこのような単純なシステムを見つけるには、しませんでした。
私は、ほぼすべてのオフィスで主にオープンソースのソフトウェアやツールを利用使用して、基本的にフリーのシステムを作成しました。 技術は基本的に実証され、実行し、期待どおりに動作表示されます。 うまくいけば、私は非常に簡単な設定されていない多くの仕事におよびあなたは、安い、Â、強力で、すべての拡張を同時にされるオフィスグリッドコンピューティングシステムを展開することができますことを示している。
システムが起動され、実行されるほとんどのカスタマイズ、あなたがすることができます改善の量には終わりがない。 例の統計情報/ベンチマークについて簡単にそのようなシステムの価値を、毎日を示す追加することができます。 新しいマシンは、迅速かつ容易に追加することができます彼らはあなたの処理能力を強化し、既存のハードウェアにアップグレードして到着したとき。
私は、あなたがこのシリーズの記事を読んで楽しんできた願っ事務所グリッドシステムを実行しているのあなたに思考の糧を与えられます。 解決策は、必ずしもすべての状況では動作しませんが、独自のソリューションを使用して行う処理データを取得できるように適応する必要がありますここで紹介する。
私に何かコメント、修正、または改善、お気軽にしてくださいと私は一致するように更新この記事を維持するために最善を尽くします。