Perl mp2 翻訳 OS とハードウェアの選択 (d212)

セラ (perlackline)

2021年07月21日 14:01

目次 - Perl Index


Theme



Perl について、復習を兼ねて断片的な情報を掲載して行く連載その d212 回。

今回は、mod_perl「 Documentation / General Documentation / Part IV: Server Administration / Choosing an Operating System and Hardware 」を翻訳して確認します。

正確な内容は 原文 を確認してください。誤解や誤訳がある場合はご指摘ください。




説明 : Description



Before you use the techniques documented on this site to tune servers and write code you need to consider the demands which will be placed on the hardware and the operating system. There is no point in investing a lot of time and money in configuration and coding only to find that your server's performance is poor because you did not choose a suitable platform in the first place.

あなたがこのサイトでドキュメント化されたテクニックを使ってサーバの調整をしたりコードを書く前にあなたはハードウェアとオペレーティングシステムに課せられる要求を考慮する必要があります. あなたが最初の段階で適切なプラットフォームを選択しなかったためにあなたのサーバのパフォーマンスがプアであることに気づくためだけに構成やコーディングに多くの時間とお金を投資しても意味がありません.
While the tips below could apply to many web servers, they are aimed primarily at administrators of mod_perl enabled Apache server.

以下のチップスは多くのウェブサーバに適用できますが, それらは主に mod_perl が有効化された Apache server の管理者向けです.
Because hardware platforms and operating systems are developing rapidly (even while you are reading this document), this discussion must be in general terms.

ハードウェアプラットフォームとオペレーティングシステムは迅速に開発されているため (あなたがこのドキュメントを呼んでいる間にも), このドキュメントは一般的な用語でなければなりません.


OS の選択 : Choosing an Operating System



First let's talk about Operating Systems (OSs).

最初にオペレーティングシステム (OSs) について話しをしましょう.
Most of the time I prefer to use Linux or something from the *BSD family. Although I am personally a Linux devotee, I do not want to start yet another OS war.

ほとんどの場合で私は Linux や *BSD ファミリの何かを使うことを好みます. 私は個人的に Linux 愛好家であるものの, 私はもうひとつの OS 戦争を始めたいとは思いません.
I will try to talk about what characteristics and features you should be looking for to support an Apache/mod_perl server, then when you know what you want from your OS, you can go out and find it. Visit the Web sites of the operating systems you are interested in. You can gauge user's opinions by searching the relevant discussions in newsgroups and mailing list archives. Deja - http://deja.com and eGroups - http://egroups.com are good examples. I will leave this fan research to the reader.

私は Apache/mod_perl サーバをサポートするためにあなたがどのような特性や機能を探すべきで, あなたがあなたの OS に何を求めるかをあなたが理解した時に, あなたがそれを探しに行けるような話しをすることにトライします. あなたが興味のあるオペレーティングシステムのウェブサイトを訪れてください. あなたはニュースグループやメーリングリストのアーカイブの関連する議論を検索することでユーザの意見を計測できます. Deja - http://deja.com や eGroups - https://egroups.com はよい例です. 私はこのファンの調査を読者にお任せします.


安定性と堅牢性 : Stability and Robustness



Probably the most important features in an OS are stability and robustness. You are in an Internet business. You do not keep normal 9am to 5pm working hours like many conventional businesses you know. You are open 24 hours a day. You cannot afford to be off-line, for your customers will go shop at another service like yours (unless you have a monopoly :). If the OS of your choice crashes every day, first do a little investigation. There might be a simple reason which you can find and fix. There are OSs which won't work unless you reboot them twice a day. You don't want to use the OS of this kind, no matter how good the OS' vendor sales department. Do not follow flushy advertisements, follow developers advices instead.

おそらく OS でもっとも重要な機能は安定性と堅牢性です. あなたはインターネットビジネスにいます. あなたはあなたが知っている多くの従来型のビジネスように普通の 9am から 5pm の労働時間を維持することはありません. あなたは 1 日 24 時間オープンしています. あなたはオフラインになる余裕はありません, あなたの顧客はあなたのような他のサービスで買い物をしてしまいます (あなたが独占していない限り :). あなたの選んだ OS が毎日クラッシュするなら, 最初に少し調査を行ってください. あなたが見つけてフィックスできるシンプルな理由があるかもしれません. あなたが 1 日に 2 回再起動しないと動作しない OS があります. あなたはこの種の OS は使いたくないでしょう, どんなにその OS ベンダの営業部門がグッドであっても. 派手な広告に従わずに, 代わりに開発者のアドバイスに従ってください.
Generally, people who have used the OS for some time can tell you a lot about its stability. Ask them. Try to find people who are doing similar things to what you are planning to do, they may even be using the same software. There are often compatibility issues to resolve. You may need to become familiar with patching and compiling your OS. It's easy.

一般的に, しばらく OS を使用している人はその安定性について多くのことをあなたに伝えてくれます. 彼らに尋ねてください. あなたがやろうとしていることと同じようなことをやっている人を探してみてください, 彼らは同じソフトウェアを使っているかもしれません. 大抵は解決すべき互換性の問題があります. あなたはパッチ適用とあなたの OS のコンパイルに慣れる必要があるかもしれません. 簡単ですよ.


メモリ管理 : Memory Management



You want an OS with a good memory management, some OSs are well known as memory hogs. The same code can use twice as much memory on one OS compared to another. If the size of the mod_perl process is 10Mb and you have tens of these running, it definitely adds up!

あなたはグッドなメモリ管理をもつ OS を望み, 一部の OS はメモリホッグ (# メモリ消費が大きい) としてよく知られています. ある OS は他の OS と比較して同じコードが 2 倍多くのメモリを使います. mod_perl プロセスのサイズが 10Mb であなたがそれらを 10 個実行しているとしたら, それは間違いなく加算されます !


メモリリーク : Memory Leaks



Some OSs and/or their libraries (e.g. C runtime libraries) suffer from memory leaks. A leak is when some process requests a chunk of memory for temporary storage, but then does not subsequently release it. The chunk of memory is not then available for any purpose until the process which requested it dies. We cannot afford such leaks. A single mod_perl process sometimes serves thousands of requests before it terminates. So if a leak occurs on every request, the memory demands could become huge. Of course our code can be the cause of the memory leaks as well (check out the Apache::Leak module on CPAN). Certainly, we can reduce the number of requests to be served over the process' life, but that can degrade performance.

一部の OS and/or それらのライブラリ (e.g. C ランタイムライブラリ) はメモリリークに悩まされています. リークとはあるプロセスが一時ストレージのためにメモリのチャンク (# 塊り) をリクエストしたが, その後にそれをリリースしない場合です. メモリのチャンクは以後それをリクエストしたそのプロセスが終了するまでどのような目的にも利用できません. 私たちはそのようなリークをする余裕はありません. ときにシングルの mod_perl プロセスはそれが終了するまでに何千ものリクエストをサーブすることがあります. ですからすべてのリクエストでリークが生じると, そのメモリ要求が巨大になるかもしれません. もちろん私たちのコードもそのメモリリークの原因になりえます (CPAN の Apache::Leak モジュールをチェックしてください). 確かに, そのプロセスライフでサーブされるリクエストの数を減らすことができますが, それはパフォーマンスを低下させてしまいます.


メモリの共有 : Sharing Memory



We want an OS with good memory sharing capabilities. As we have seen, if we preload the modules and scripts at server startup, they are shared between the spawned children (at least for a part of a process' life - memory pages can become "dirty" and cease to be shared). This feature can reduce memory consumption a lot!

私たちはグッドなメモリ共有機能の OS が必要です. 私たちが見たように, 私たちがモジュールとサーバスクリプトをスタートアップでプリロードすると, それらは生成された children 間で共有されます (少なくともプロセスライフの一部は - メモリパージは "ダーティ" になり共有されなくなることがあります). この機能はメモリ消費を大幅に削減できます !


コストとサポート : Cost and Support



If we are in a big business we probably do not mind paying another $1000 for some fancy OS with bundled support. But if our resources are low, we will look for cheaper and free OSs. Free does not mean bad, it can be quite the opposite. Free OSs can have the best support we can find. Some do. It is very easy to understand - most of the people are not rich and will try to use a cheaper or free OS first if it does the work for them. Since it really fits their needs, many people keep using it and eventually know it well enough to be able to provide support for others in trouble. Why would they do this for free? One reason is for the spirit of the first days of the Internet, when there was no commercial Internet and people helped each other, because someone helped them in first place. I was there, I was touched by that spirit and I am keen to keep that spirit alive.

私たちがビッグビジネスに携わっているなら私たちはサポートがバンドルされた何らかファンシー (# 高級) な OS に別途 $1000 支払うことをおそらく気にしません. しかし私たちのリソースが少ない場合, 私たちはより安価でフリーの OS を探すでしょう. フリーはバッドを意味せず, まったく逆のことがあります. フリー OS は私たちが見つけられるベストのサポートをもつことができます. そうする人もいます. それを理解するのはとても簡単です - 多くの人はリッチではなくそれが彼らのために機能するならより安価またはフリー OS を最初に使おうと試みます. それは彼らのニーズに本当にフィットするので, 多くの人はそれを使い続け結局はトラブルにある他の人にサポートを提供出来るほどにそれを理解します. なぜ彼らはこれをフリーで行うのか ? ひとつの理由はインターネットの初期のスピリットによるもので, そのときは商業インターネットがなく人々は互いに助け合っていました, 最初の段階で誰かが彼らを助けたからです. 私はそこにいて, 私はそのスピリットに感銘を受けたので私はそのスピリットを生かし続けたいと思っています.
But, let's get back to our world. We are living in material world, and our bosses pay us to keep the systems running. So if you feel that you cannot provide the support yourself and you do not trust the available free resources, you must pay for an OS backed by a company, and blame them for any problem. Your boss wants to be able to sue someone if the project has a problem caused by the external product that is being used in the project. If you buy a product and the company selling it claims support, you have someone to sue or at least to put the blame on.

しかし, 私たちの世界に戻りましょう. 私たちはマテリアルワールド (# 物質世界) に住んでいて, 私たちのボスはシステムの稼働を維持するために私たちに支払いをしています. ですからもしあなたがあなた自身でサポートを提供できないとあなたが感じてあなたが利用可能なフリーリソースを信頼できないなら, あなたは企業が支援する OS に支払いをして, あらゆる問題の責任を負わせなければなりません. あなたのボスはプロジェクトがプロジェクト内で使われている外部製品により生じた問題をもった場合に誰かを訴えられるようにしたいと思っています. あなたが製品を購入してそれを販売している企業がサポートを主張する場合, あなたは訴える相手がいて少なくとも責任を負わせることができます.
If we go with Open Source and it fails we do not have someone to sue... wrong--in the last years many companies have realized how good the Open Source products are and started to provide an official support for these products. So your boss cannot just dismiss your suggestion of using an Open Source Operating System. You can get a paid support just like with any other commercial OS vendor.

私たちがオープンソースにいってそれが失敗した場合に私たちは訴える相手をもちません ... 間違いです -- ここ数年多くの企業がオープンソースプロダクトがどのようグッドであるかに気づいてそれらのプロダクトのための公式サポートの提供を開始しています. ですからあなたのボスはオープンソースのオペレーティングシステムの利用するあなたの提案を却下できません. あなたはちょうど他の商用 OS ベンダと同じように有料サポートをえることができます.
Also remember that the less money you spend on OS and Software, the more you will be able to spend on faster and stronger hardware.

またあなたが OS やソフトウェアに費やすお金が少ないほど, あなたはより多くをより速く強いハードウェアに費やせることを忘れないでください.


ディスコンのプロダクト : Discontinued Products



The OSs in this hazard group tend to be developed by a single company or organization.

このハザードグループの OS は単一の企業や組織によって開発される傾向があります.
You might find yourself in a position where you have invested a lot of time and money into developing some proprietary software that is bundled with the OS you chose (say writing a mod_perl handler which takes advantage of some proprietary features of the OS and which will not run on any other OS). Things are under control, the performance is great and you sing with happiness on your way to work. Then, one day, the company which supplies your beloved OS goes bankrupt (not unlikely nowadays), or they produce a newer incompatible version and they will not support the old one (happens all the time). You are stuck with their early masterpiece, no support and no source code! What are you going to do? Invest more money into porting the software to another OS...

あなたはあなたが選択した OS にバンドルされた何らかのプロプライエタリ (# 独占的な) ソフトウェアの開発にあなたが多くの時間とお金を費やす立場 (OS の何らかプロプライエタリな機能のアドバンテージをとる mod_perl ハンドラを書いてそれが他の OS では走らないといった) にいることをあなた自身で気づくかもしれません. ものごとはコントロール下にあり, そのパフォーマンスはグレートであなたはあなたの通勤中に幸せに歌います. その後, ある日, あなたの愛しい OS を提供する企業が破産する (今日ではなくもない), または彼らが新しい非互換のバージョンを作成して古いものをサポートしなくなります (常にあります). あなたは彼らの初期のマスターピースでスタックします (# 行き詰ります), サポートはなくソースコードもないのです ! あなたは何をする ? ソフトウェアを別の OS に移植することに多くのお金を投資してください ...
Everyone can be hit by this mini-disaster so it is better to check the background of the company when making your choice. Even so you never know what will happen tomorrow - in 1980, a company called Tektronix did something similar to one of the Guide reviewers with its microprocessor development system. The guy just had to buy another system. He didn't buy it from Tektronix, of course. The second system never really worked very well and the firm he bought it from went bust before they ever got around to fixing it. So in 1982 he wrote his own microprocessor development system software. It didn't take long, it works fine, and he's still using it 18 years later.

誰でもこの小さな災害にヒットする可能性があるのであなたが選択をするときはその企業の背景をチェックすることがベターです. それでもなお明日おきることをあなたは決してわかりません - 1980 年, Tektronix という企業がマイクロプロセッサ開発システムでガイドレビュアの 1 人に同じことを行いました. その人は他のシステムを買うしかありませんでした。もちろん, 彼は Tektronix から買うことはしませんでした. その 2 番目のシステムは実際にはうまく機能することはなく彼がそれを買った会社はそのフィックスにまで手が回らずに破綻しました. そして 1982 年彼は彼独自のマイクロプロセッサ開発システムソフトウェアを書きました. 長い時間はかからず, それはよく機能し, 彼は 18 年後もまだそれを使っています.
Free and Open Source OSs are probably less susceptible to this kind of problem. Development is usually distributed between many companies and developers, so if a person who developed a really important part of the kernel lost interest in continuing, someone else will pick the falling flag and carry on. Of course if tomorrow some better project shows up, developers might migrate there and finally drop the development: but in practice people are often given support on older versions and helped to migrate to current versions. Development tends to be more incremental than revolutionary, so upgrades are less traumatic, and there is usually plenty of notice of the forthcoming changes so that you have time to plan for them.

フリーでオープンソースの OS はおそらくこの種の問題の影響は受けにくいです. 開発は通常多くの企業と開発者の間で分散されているので, もしカーネルの本当に重要な部分を開発した人が継続の興味を失ったとしても, 他の誰かが落ちる旗を拾って引き継ぐでしょう. もちろんもし明日何かベターなプロジェクトが現れたら, 開発者はそこに移行して最後にその開発がドロップ (# 中止) するかもしれません: しかし実際には人々は大抵古いバージョンでのサポートを与え現在のバージョンへの移行を支援します. 開発は革命的というよりもより段階的な傾向があるので, アップグレードは痛みが少なく, 通常はあなたが来る変更のための計画をする時間を持つためにその十分な通知があります.
Of course with the Open Source OSs you can have the source! So you can always have a go yourself, but do not under-estimate the amounts of work involved. There are many, many man-years of work in an OS.

もちろんオープンソースであなたはソースをもつことができます ! ですからあなたは常にあなた自身でチャレンジできますが, 関連する作業量を過小評価はしないでください. OS には何年も, 何年もの人々の仕事があるのです.


OS リリース : OS Releases



Actively developed OSs generally try to keep pace with the latest technology developments, and continually optimize the kernel and other parts of the OS to become better and faster. Nowadays, Internet and networking in general are the hottest topics for system developers. Sometimes a simple OS upgrade to the latest stable version can save you an expensive hardware upgrade. Also, remember that when you buy new hardware, chances are that the latest software will make the most of it.

アクティブに開発されている OS は通常最新のテクノロジー開発に追随することにトライし, より良くより高速になるように継続して OS のカーネルや他のパーツを最適化します. 今日では, システム開発者にとって一般的にインターネットとネットワーキングがもっともホットなトピックです. 最新の安定バージョンへのシンプルな OS のアップグレードがあなたの高価なハードウェアアップグレードを節約できる場合があります. また, あなたが新しいハードウェアを買えば, 最新のソフトウェアを最大限活用できる可能性があることも忘れないで下さい.
If a new product supports an old one by virtue of backwards compatibility with previous products of the same family, you might not reap all the benefits of the new product's features. Perhaps you get almost the same functionality for much less money if you were to buy an older model of the same product.

新しいプロダクトが同じファミリの前のプロダクトとの後方互換を理由として古いものをサポートしている場合, あなたはその新しいプロダクトの機能の利点のすべてをえられないかもしれません. あなたが同じプロダクトの古いモデルを買った場合にあなたはより少ないお金でほとんど同じ機能をゲットすることもありえます.


ハードウェアの選択 : Choosing Hardware



Sometimes the most expensive machine is not the one which provides the best performance. Your demands on the platform hardware are based on many aspects and affect many components. Let's discuss some of them.

最も高価なマシンがそのベストパフォーマンスを提供するものではない場合があります. あなたのプラットフォームハードウェアの要求は多くの側面に基づいていて多くのコンポーネントに影響します。それらのいくつかについて論じましょう.
In the discussion we use terms that may be unfamiliar to some readers:

このディスカッションで私たちは一部読者にとって馴染みのない用語を使うかもしれません:



予想されるサイトトラフィックに対応したマシンの強度要求 : Machine Stength Demands According to Expected Site Traffic



If you are building a fan site and you want to amaze your friends with a mod_perl guest book, any old 486 machine could do it. If you are in a serious business, it is very important to build a scalable server. If your service is successful and becomes popular, the traffic could double every few days, and you should be ready to add more resources to keep up with the demand. While we can define the webserver scalability more precisely, the important thing is to make sure that you can add more power to your webserver(s) without investing much additional money in software development (you will need a little software effort to connect your servers, if you add more of them). This means that you should choose hardware and OSs that can talk to other machines and become a part of a cluster.

あなたがファンサイトを構築していてあなたの友達を mod_perl のゲストブックで驚かしたいなら, 古い 486 マシンでそれを行うことができます. あなたがシリアスなビジネスに携わっているなら, スケーラブルなサーバを構築することはとても重要です. あなたのサービスが成功して人気になった場合, そのトラフィックは数日ごとに倍になるかもしれず, あなたはその需要に対応するためにより多くのリソースの追加の準備をしなければなりません. 私たちはウェブサーバのスケーラビリティをより正確に定義できる一方で, 重要なことはソフトウェア開発でより多くの費用を追加することなくあなたのウェブサーバにより多くのパワーを追加できるようにしておくことです (あなたがより多くのサーバを追加するなら, あなたのそれを接続するために少しのソフトウェアの労力が必要になるでしょう). これはあなたが他のマシンと通信しクラスタの一部になれるハードウェアと OS を選択しなければならないことを意味します.
On the other hand if you prepare for a lot of traffic and buy a monster to do the work for you, what happens if your service doesn't prove to be as successful as you thought it would be? Then you've spent too much money, and meanwhile faster processors and other hardware components have been released, so you lose.

その一方であなたが大量のトラフィックに対する備えをしてモンスターを購入しあなたのために仕事を行わせたとして, あなたのサービスがあなたが思ったほど成功しないことが分かった場合はどうなりますか ? そうしてあなたはあまりに多くのお金を消耗したことになり, そしてその間により高速なプロセッサと他のハードウェアコンポーネントがリリースされます, そしてあなたは負けるのです.
Wisdom and prophecy, that's all it takes :)

知恵と予言, それが必要なすべて :)


ひとつの強いマシン vs 多くの弱いマシン : Single Strong Machine vs Many Weaker Machines



Let's start with a claim that a four years old processor is still very powerful and can be put to a good use. Now let's say that for a given amount of money you can probably buy either one new very strong machine or about ten older but very cheap machines. I claim that with ten old machines connected into a cluster and by deploying load balancing you will be able to serve about five times more requests than with one single new machine.

4 年前のプロセッサがまだとてもパワフルでグッドに使えるという主張ではじめましょう. いまあなたは与えられた量のお金でひとつの新しいとても強力なマシンか約 10 個の古くてとても安いマシンを買えるとしましょう. 私はクラスタに接続された 10 個の古いマシンでロードバランシングを展開することによってあなたは1 つの新しいマシンの約 5 倍多くリクエストをサーブできると主張します.
Why is that? Because generally the performance improvement on a new machine is marginal while the price is much higher. Ten machines will do faster disk I/O than one single machine, even if the new disk is quite a bit faster. Yes, you have more administration overhead, but there is a chance you will have it anyway, for in a short time the new machine you have just bought might not stand the load. Then you will have to purchase more equipment and think about how to implement load balancing and web server file system distribution anyway.

それはなぜ ? なぜなら一般的に新しいマシンでのパフォーマンスの向上はわずかな一方でその価格はかなり高いです. 新しいディスクがかなり高速であったとしても, 10 個のマシンは 1 つのマシンより高速なディスク I/O を行います. はい, あなたはより多くを管理するオーバヘッドをもちますが, あなたが購入したばかりの新しいマシンがまもなくその負荷に耐えられなくなる, というようなことをあなたがもつ可能性があります. そうしてあなたはとにかくより多くの機器を購入しどのようにロードバランシングを実装してウェブサーバのファイルシステムの分散させるかを考えなければならなくなります.
Why I'm so convinced? Look at the busiest services on the Internet: search engines, web-email servers and the like -- most of them use a clustering approach. You may not always notice it, because they hide the real implementation behind proxy servers.

なぜ私がそれほど確信しているか ? インターネットでもっともいそがしいサービスを探してください: 検索エンジン, ウェブ e メールサーバなど -- それらのほとんどはクラスタリングアプローチを使っています. あなたが常にそれに気づくわけではありません, なぜならそれらはプロキシサーバの背後に実際の実装が隠れているからです.


インターネット接続 : Internet Connection



You have the best hardware you can get, but the service is still crawling. Make sure you have a fast Internet connection. Not as fast as your ISP claims it to be, but fast as it should be. The ISP might have a very good connection to the Internet, but put many clients on the same line. If these are heavy clients, your traffic will have to share the same line and your throughput will suffer. Think about a dedicated connection and make sure it is truly dedicated. Don't trust the ISP, check it!

あなたはあなたがゲットできるベストなハードウェアを持っていますが, サービスはいまだクロール中 (# よちよち) です. あなたが高速なインターネット接続をもっていることを確認してください. ISP が主張するほどそれは高速ではありませんが, それはそれなりの速さです. ISP はインターネットへのとてもグッドな接続をもっているかもしれませんが, 同じライン上に多くのクライアントをおきます. もしそれらがヘビーなクライアントだった場合, あなたのトラフィックは同じ回線を共有せねばならずあなたのスループットは苦しむでしょう. 専用の接続について考えてそれが本当に専用であることを確認してください. ISP を信用せず, それをチェックしてください !
The idea of having a connection to The Internet is a little misleading. Many Web hosting and co-location companies have large amounts of bandwidth, but still have poor connectivity. The public exchanges, such as MAE-East and MAE-West, frequently become overloaded, yet many ISPs depend on these exchanges.

インターネットへの接続をもつというアイデアは少しミスリーディングです. 多くのウェブホスティングとコロケーション (# 場所貸し) 企業は大量の帯域幅を持っていますが, それにしては接続性がプアです. MAE-East や MAE-West のような, パブリックなエクスチェンジは, よく過負荷になりますが, 多くの ISP はまだそれらのエクスチェンジに依存しています.
Private peering means that providers can exchange traffic much quicker.

プライベートのピアリングはより速いトラフィックの交換を提供できることを意味します.
Also, if your Web site is of global interest, check that the ISP has good global connectivity. If the Web site is going to be visited mostly by people in a certain country or region, your server should probably be located there.

また, あなたのウェブサイトがグローバルな関心があるなら, ISP がグッドなグローバルの接続性をもっているかをチェックしてください. ウェブサイトが主に特定の国や地域の人々によって訪れられるようになったら, おそらくあなたのサーバをそこに配置したほうがよいでしょう.
Bad connectivity can directly influence your machine's performance. Here is a story one of the developers told on the mod_perl mailing list:

バッドな接続性はあなたのマシンのパフォーマンスにダイレクトに影響します. こちらはある開発者が mod_perl メーリングリストで語ったストーリーです:

What relationship has 10% packet loss on one upstream provider got to do with machine memory ?

あるアップストリームのプロバイダで発生した 10% のパケットロスはマシンメモリとどのように関係しますか ?
Yes.. a lot. For a nightmare week, the box was located downstream of a provider who was struggling with some serious bandwidth problems of his own... people were connecting to the site via this link, and packet loss was such that retransmits and tcp stalls were keeping httpd heavies around for much longer than normal.. instead of blasting out the data at high or even modem speeds, they would be stuck at 1k/sec or stalled out... people would press stop and refresh, httpds would take 300 seconds to timeout on writes to no-one.. it was a nightmare. Those problems didn't go away till I moved the box to a place closer to some decent backbones.

イエス.. たくさんあります. 悪夢の週間で, そのボックスはいくつかのシリアスな帯域幅の独自の問題にあえいでいるプロバイダのダウンストリームに配置されていました.. 人々はこのリンクを介してそのサイトに接続していて, パケットロスは再送や tcp ストールが普通よりもはるかに長く httpd の重いものをキープするもののようでした. より速くあるいはモデムのスピードでデータを吐き出す代わりに, それらは 1k/秒でスタックするかストール (# 失速) します.. 人々はストップとリフレッシュを押しましたし, httpd は誰向けでもない書込みのためのタイムアウトに 300 秒とりました.. それは悪夢でした. これらの問題は私がそのボックスをいくつかまともなバックボーンに近い場所に移動するまで無くなりませんでした.
Note that with a proxy, this only keeps a lightweight httpd tied up, assuming the page is small enough to fit in the buffers. If you are a busy internet site you always have some slow clients. This is a difficult thing to simulate in benchmark testing, though.

プロクシでは, そのページがバッファにフィットする程度に小さいと仮定すると, これは軽量の httpd に結びつけたままにするだけであることに, 注意してください. あなたがいそがしいインターネットサイトならあなたは常に遅いクライアントを持っています. これはベンチマークでシミュレートが難しいもの, ですが.



I/O パフォーマンス : I/O Performance



If your service is I/O bound (does a lot of read/write operations to disk) you need a very fast disk, especially if the you need a relational database, which are the main I/O stream creators. So you should not spend the money on Video card and monitor! A cheap card and a 14" monochrome monitor are perfectly adequate for a Web server, you will probably access it by telnet or ssh most of the time. Look for disks with the best price/performance ratio. Of course, ask around and avoid disks that have a reputation for headcrashes and other disasters.

あなたのサービスが I/O バウンド (ディスクに 読み/書き 操作を多く行う) の場合あなたはとても高速なディスクが必要です, あなたが主な I/O ストリームの生成者である, リレーショナルデータベースを必要とするなら特にです. ですからあなたはビデオカードやモニタにお金を費やすべきではありません ! ウェブサーバのためには安価なカードと 14" モノクロモニタで完全に十分であり, あなたはおそらくほとんどの場合 telnet や ssh でそれにアクセスするでしょう. ベストな プライス/パフォーマンス比 のディスクを探してください. もちろん, ヘッドクラッシュや他の災難の評判をもつディスクを周囲に尋ねて回避してください.
You must think about RAID or similar systems if you have an enormous data set to serve (what is an enormous data set nowadays? Gigabytes, Terabytes?) or you expect a really big web traffic.

あなたがサーバに巨大なデータセットを持っていたり (昨今の巨大なデータセットとは何だろうか ? ギガバイト, テラバイト ?) あなたが本当に大きなウェブトラフィックを予期する場合あなたは RAID や同様のシステムについて考えなければなりません.
Ok, you have a fast disk, what's next? You need a fast disk controller. There may be one embedded on your computer's motherboard. If the controller is not fast enough you should buy a faster one. Don't forget that it may be necessary to disable the original controller.

Ok, あなたは高速なディスクをもっています, 次は何 ? あなたは高速なディスクコントローラが必要です. それはあなたのコンピュータのマザーボードに埋め込まれているものかもしれません. そのコントローラが十分に高速ではない場合あなたはより高速なそれを購入しなければなりません. そのオリジナルのコントローラを無効にすることが必須であるかもしれないことを忘れずに.


メモリ : Memory



Memory should be well tested. Many memory test programs are practically useless. Running a busy system for a few weeks without ever shutting it down is a pretty good memory test. If you increase the amount of RAM on a well-tested box, use well-tested RAM.

メモリはよくテストされなければなりません. 多くのメモリテストプログラムは実質的には役立たずです. シャットダウンすることなく数週間いそがしいシステムを実行することはとてもグッドなメモリテストです. あなたがよくテストされたボックスで RAM の量を増やす場合は, よくテストされた RAM を使ってください.
How much RAM do you need? Nowadays, the chances are that you will hear: "Memory is cheap, the more you buy the better". But how much is enough? The answer is pretty straightforward: you do not want your machine to swap. When the CPU needs to write something into memory, but memory is already full, it takes the least frequently used memory pages and swaps them out to disk. This means you have to bear the time penalty of writing the data to disk. If another process then references some of the data which happens to be on one of the pages that has just been swapped out, the CPU swaps it back in again, probably swapping out some other data that will be needed very shortly by some other process. Carried to the extreme, the CPU and disk start to thrash hopelessly in circles, without getting any real work done. The less RAM there is, the more often this scenario arises. Worse, you can exhaust swap space as well, and then your troubles really start...

あなたはどのくらいの量の RAM が必要か ? 今日では, あなたは聞く可能性があります: "メモリは安い, あなたはより多く買うのがベター". でもどのくらいが十分ですか ? 答えはとても簡単です: あなたはあなたのマシンをスワップさせたくありません. CPU が何かをメモリに書込む必要があるが, メモリがすでにフルのとき, それはもっとも使用頻度の低いメモリページをとってそれらをディスクにスワップアウトします. これはあなたがデータをディスクに書込む時間のペナルティに耐えなければならないことを意味します. もし他のプロセスがその後にスワップアウトが発生したばかりのページのデータの一部を参照すると, CPU はそれを再度スワップインして, おそらく他のプロセスによってすぐに必要とされる一部データをスワップアウトします. 極端になると, CPU とディスクはあらゆるリアルな作業を行うことなく, 絶望的なサークルに陥ります. RAM が少ないほど, このシナリオがより頻繁に発生します. さらに悪く, あなたはスワップスペースも使いつくすことができてしまい, そうなるとあなたのトラブルがリアルにスタートします...
How do you make a decision? You know the highest rate at which your server expects to serve pages and how long it takes on average to serve one. Now you can calculate how many server processes you need. If you know the maximum size your servers can grow to, you know how much memory you need. If your OS supports memory sharing, you can make best use of this feature by preloading the modules and scripts at server startup, and so you will need less memory than you have calculated.

どのようにあなたは決定をしますか ? あなたはあなたのサーバがページのサーブをするために期待する最高速度とそれをサーブするためにどのくらいの長さのアベレージとるかを知っています. これであなたはどのくらいのサーバプロセスをあなたが必要かを計算できます. あなたがあなたのサーバが成長できる最大サイズを知っているなら, あなたはどのくらいのメモリがあなたが必要かをあなたはわかります. もしあなたの OS がメモリ共有をサポートしているなら, あなたはサーバのスタートアップでそのモジュールとスクリプトをプレロードすることによってこの機能を最大限活用できますので, あなたが計算したよりもあなたが必要なメモリは少なくなります.
Do not forget that other essential system processes need memory as well, so you should plan not only for the Web server, but also take into account the other players. Remember that requests can be queued, so you can afford to let your client wait for a few moments until a server is available to serve it. Most of the time your server will not have the maximum load, but you should be ready to bear the peaks. You need to reserve at least 20% of free memory for peak situations. Many sites have crashed a few moments after a big scoop about them was posted and an unexpected number of requests suddenly came in. (This is called the Slashdot effect, which was born at http://slashdot.org ). If you are about to announce something cool, be aware of the possible consequences.

他の不可欠なシステムのプロセスもメモリが必要であることを忘れないでください, ですからあなたはウェブサーバのためだけではなく, 他のプレイヤーも考慮して計画するべきです. リクエストはキューにできるので, あなたはあなたのクライアントをサーバがそれをサーブできるようになるまでしばらく待たせる余裕があることを覚えておいてください. ほとんどの場合あなたのサーバは最大負荷をもつことはありませんが, あなたはピークに耐える準備はできるているはずです. ピーク状況のためにあなたは少なくともフリーメモリの 20% を予約する必要があります. 多くのサイトは彼らに関する大きなスクープが投稿され突然予期しない数のリクエストが来てからまもなくクラッシュしました. (これは Slashdot 効果とよばれ, それは http://slashdot.org で生まれました). もしあなたが何かクールなことについてアナウンスするなら, 起こりうる結果に注意してください.


CPU



Make sure that the CPU is operating within its specifications. Many boxes are shipped with incorrect settings for CPU clock speed, power supply voltage etc. Sometimes a cooling fan is not fitted. It may be ineffective because a cable assembly fouls the fan blades. Like faulty RAM, an overheating processor can cause all kinds of strange and unpredictable things to happen. Some CPUs are known to have bugs which can be serious in certain circumstances. Try not to get one of them.

CPU がその仕様内で動作していることを確認してください. 多くのボックスは CPU クロックスピード, 電源電圧などが正しくない設定で出荷されています. 冷却ファンが装備されていない場合があります. ケーブルアセンブリ (# 組付け) がファンの羽根にもつれて (# fouls) 効果がない場合があります. 欠陥のある RAM と同じく, 過熱したプロセッサはあらゆる種類の奇妙で予測不可能なことが発生する原因になります. 一部の CPU は特定の状況でシリアスになるバグを持っていることが知られています. そういうものをゲットしないようにしてください.


ボトルネック : Bottlenecks



You might use the most expensive components, but still get bad performance. Why? Let me introduce an annoying word: bottleneck.

あなたはもっとも高価なコンポーネントを使うかもしれませんが, それでもバッドなパフォーマンスをえることがあります. なぜ ? 私が忌々しいワードを紹介しましょう: ボトルネック.
A machine is an aggregate of many components. Almost any one of them may become a bottleneck.

マシンは多くのコンポーネントの集合体です. それらのほとんど全部がボトルネックになりえます.
If you have a fast processor but a small amount of RAM, the RAM will probably be the bottleneck. The processor will be under-utilized, usually it will be waiting for the kernel to swap the memory pages in and out, because memory is too small to hold the busiest pages.

もしあなたが高速なプロセッサをもっていても RAM の量が少ない場合, その RAM はおそらくボトルネックになります. そのプロセッサは十分に活用されません, 通常それはカーネルがメモリページをスワップインしたりアウトすることを待ちます, なぜならメモリが最もビジーなページを保持するには小さすぎるからです.
If you have a lot of memory, a fast processor, a fast disk, but a slow disk controller, the disk controller will be the bottleneck. The performance will still be bad, and you will have wasted money.

もしあなたが多くのメモリ, 高速なプロセッサ, 高速なディスクをもっていても, ディスクコントローラが遅いなら, そのディスクコントローラがボトルネックになります. そのパフォーマンスはまだバッドであり, あなたはお金を無駄にするでしょう.
Use a fast NIC that does not create a bottleneck. They are cheap. If the NIC is slow, the whole service is slow. This is a most important component, since webservers are much more often network-bound than they are disk-bound!

ボトルネックを生成しない高速な NIC を使ってください. それらは安価です. NIC が遅いと, サービス全体が遅いです. これはもっとも重要なコンポートネントです, ウェブサーバはディスクに繋がれるよりもずっともっと頻繁にネットワークに繋がれるからです !


ハードウェア要件の競合の解決 : Solving Hardware Requirement Conflicts



It may happen that the combination of software components which you find yourself using gives rise to conflicting requirements for the optimization of tuning parameters. If you can separate the components onto different machines you may find that this approach (a kind of clustering) solves the problem, at much less cost than buying faster hardware, because you can tune the machines individually to suit the tasks they should perform.

あなたがあなた自身で見つけたソフトウェアコンポーネントの組み合わせを使っているとチューニングパラメータの最適化で要件の競合が起こる可能性があります. もしあなたがそのコンポーネントを異なるマシンに分けられるならより高速なハードウェアを買うよりもはるかに低いコストで, あなたはこのアプローチ (一種のクラスタリング) がその問題を解決することに気づくはずです, なぜならあなたはそのマシンが実行すべきタスクにあわせてそれらを個別に調整できるからです.
For example if you need to run a relational database engine and mod_perl server, it can be wise to put the two on different machines, since while RDBMS need a very fast disk, mod_perl processes need lots of memory. So by placing the two on different machines it's easy to optimize each machine at separate and satisfy the each software components requirements in the best way.

例えばあなたがリレーショナルデータベースエンジンと mod_perl サーバを実行する必要がある場合は, 2 つの異なるマシンにおくと賢明です, RDBMS がとても高速なディスクを必要とする一方で, mod_perl プロセスは多くのメモリを必要とするからです. ですから 2 つの異なるマシンに配置するとベストな方法で各マシンを最適化して各ソフトウェアコンポーネントの要件を満たすことが簡単です.


結論 : Conclusion



To use your money optimally you have to understand the hardware very well, so you will know what to pick. Otherwise, you should hire a knowledgeable hardware consultant and employ them on a regular basis, since your needs will probably change as time goes by and your hardware will likewise be forced to adapt as well.

あなたのお金を最適に使うためにあなたはハードウェアをよく理解しなければなりません, そうすれば何をピックすればよいかがわかります. そうでないなら, あなたは知識が豊富なハードウェアコンサルタントを一時的に雇ったり彼らを定期的に雇用しなければならないはずです, あなたのニーズはおそらく時間の経過とともに変化しあなたのハードウェアも同様に適応することを強制されるからです.


メンテナ : Mainteiners



Maintainer is the person(s) you should contact with updates, corrections and patches.



作者 : Authors



Only the major authors are listed above. For contributors see the Changes file.





NEXT



次回は、「 Documentation / General Documentation / Part IV: Server Administration / Controlling and Monitoring the Server 」を「 mod_perl 」公式サイト (https://perl.apache.org/index.html) より確認します。


参考情報は書籍「 続・初めての Perl 改訂版 」, 「 Effective Perl 第 2 版 」を中心に perldoc, Wikipedia および各 Web サイト。それと詳しい先輩。

目次 - Perl Index

























関連記事