はじめに
私たちは毎日のデータを何百万ものレコードを処理する多くのバッチジョブを実行すると私は数時間何もしないそれぞれの毎日を囲んで座るすべてのマシンについて最近考えていた会社で働いています。 我々はシステムの処理能力を強化するため、それらのマシンを使用できれば良いのではないでしょうか? この記事のセットでは、私はオフィスの採用の潜在的な利点を見てするつもりグリッド仮想化環境を使用して。
In 第4回我々は、得られた結果は常に最新のビジネス情報とロジックと最新になるように、我々はコードとデータソースの最新バージョンを実行していることを確認するためのツールを使用して見ました。
配置前
あなたが行うことが一つと、一つのことだけであるかどうグリッド·システムをデプロイする前に、それはベンチマーク現在のシステムです ! あなたのシステムがあなたの保証は何もありません、これをバックアップする番号を持っていない限り、何しようとしているどれだけ余分な仕事について同僚に言うかは関係ありません。 だから、
- あなたは現在どのように多くのレコードを処理することができますか? 日あたり? 時間当たり?
- それは典型的に仕事を変えるためにどのくらいかかりますか?
- あなたはどのくらい多くの容量を持っていますか?
追加の質問もあります:
- あなたの処理サーバ(または処理サーバーのいずれか)がどのようにこれはあなたの能力に影響を与えるダウンした場合には、不自由されますか?
- どのような利点は、/グリッドシステムから得ることを期待してほしいですか?
- あなたのオフィスのマシンでは、ジョブを実行することができるでしょうか?
- あなた(またはあなたのジョブが変換することができます)が実行中のこのスタイルでwrokしていますか?
最後の主要なポイントは、このような大規模な変更に時間を取ることです。 再び新たな方法論、ベンチマークを使用して動作するように処理コードを更新します。 おそらく、仮想マシンを実行するには、処理サーバを設定し、すべての処理サーバの直後に(比較的だけの非常に強力なもの)別のワーカーになります。 新しいプロセスが解決することができます。
展開
私の提案は、すべてのインストールとセットアップを行うオフィス週末にポップアップするでしょう。 ちょうど二週間の休暇の前にこれを行うと...結果に対処するために荒れそうでないかもしれないので、他の貧しいままに ...
このようなシステムの展開が遅くなる必要があります。 それがこのシステムを設定することは比較的単純であるにもかかわらず、あなたの全体のオフィスのインフラストラクチャ(よくデジタル1)に影響を与えます。 まず、労働者のホストが日常的に実行する方法モニターのネットワークトラフィックを、一度にマシンのカップルにロールアウト。 あなたの調査結果に応じて、ジョブの設定を変更する必要があります。
一度システムが再度performance.Â次のベンチマークのネットワークトラフィックとホストマシンの監視を続ける(オフィスのすべてのマシンの10%、すなわち5を言うことができます)いくつかのマシンで和解した、今あなたの最初のベンチマークよりも33%以上のジョブを処理する必要があります。 これがそうですチェックするか、または少なくともこの球場にいること。 されていない場合は、先に進む前に何が起こっているか調べる。 あなたは喜んですべてのオフィス機器は、個々のマシンのパフォーマンスを殺したり、停止にあなたのネットワークを粉砕せずに実行するまで、このサイクルを繰り返します。
すべての回ですべての展開が行われた後でも、ベンチマークを保持します。 すべての労働者に報告し、ジョブを処理している確認し、新しいコードのアップデートは、システムの速度にどのような影響を与えるかを確認してください。 徐々に(非常にゆっくりと)あなたの労働者とネットワークを最大限に得るためにあなたの仕事の設定をインクリメントします。
ストップ!
何がある時点で実行して労働者を停止したい場合は? 彼らはすべてそこ、再生を実行し、空腹の虫のようなデータを処理するために最善をしようとしています。 答えは明白に思えるかもしれませんが、その価値は念のために、その見落としを追加します。 単に出口(0)を使用して処理スクリプトを編集したり、死ぬ()または他のいくつかのステートメントは、処理ジョブを殺すために。 An important reason why we always try to update to the latest processing script before any run!
Demonstration System
In order to write this set of short articles I created a very small grid to demonstrate the technologies and methodologies. I read lots of articles, tutorials, and used various tools to setup and monitor what was going on. By no means have I gone out and saturated a whole office with traffic and nor have I had access to a regular staff members PC to see how host performance was affected.
My demonstration system was very humble indeed. I used my regular desktop set up as a job control server. On this I had installed mySQL server installed set up as a master in replication, PHP , and SVN linked through apache (for access via worker VM).
I then created a centOS worker machine on VirtualBox on a 6 year old windows XP laptop. I setup scheduled tasks as specified after copying the VM onto the machine and let it go.
The virtual machine was set up with PHP, subversion, and mySQL. I checked out a branch named 'worker' from my job control servers repository and made sure it could be updated using 'svn update'. Next I setup mySQL as a slave and checked that data was replicating from mySQL on the job control server down to the worker VM. After all this I setup the bash script and the cron job.
My processing script basically went along the lines of this (very simple stuff):
- Read in the name field
- Counted the number of similar names in a table from the data source held on the VM
- Counted the number of names as above but splitting the name by spaces (ie forename, middle, surname)
- Repeated this process 1,000 times
Each job took approximately 20 minutes to run. At one point I opened several copies of the worker VM on the windows laptop and watched the jobs be checked off by each of the worker IP addresses. At this point I also confirmed that replication automatically restarted.
Leaving the laptop to idle resulted in a worker starting to process jobs from the job control server. 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.
Conclusions / Evaluation
The next obvious step would be to actually get a real world example and start to deploy a system such as this within an office environment and see what happens. Asking a business to commit to this without a trail blazing company to prove the technology and effectiveness may be a little difficult. Grid/Distributed computing is very popular is some circles and has some large applications (BIONC, SETI@Home, Folding@Home, etc). I did not, however, find a smaller scale and simple system like this in my searches that could be rolled out within an office environment.
I created a basically free system using mostly open source software and tools available in almost any office. The technologies were basically demonstrated and show to perform and work as expected. Hopefully I have show that with not much work and with a very simple setup you can deploy an office grid computing system that is powerful, cheap, and scalable all at the same time.
Once a system is up and running there is almost no end to the amount of customisation and improvements you can make. For example statistics / benchmarking can easily be added showing the worth of such a system every day. New machines can be added quickly and easily as and when they arrive with upgrades to existing hardware bolstering your processing power.
I hope you've enjoyed reading this series of articles and its given you food for thought on running an office grid system. The solution presented here won't necessarily work in all situations but should be adaptable to allow you to get your data processing done using your own solution.
Please feel free to send me any comments, corrections, or improvements and I'll do my best to keep this article updated to match.