Cosminexus V9 アプリケーションサーバ 機能解説 基本・開発編(Webコンテナ)
Webクライアントからの同時接続数の制御をする場合,J2EEサーバの設定が必要です。
Webクライアントからの同時接続数の制御の設定方法および設定例について説明します。
Webクライアントからの同時接続数の制御の定義は,簡易構築定義ファイルの論理J2EEサーバ(j2ee-server)の<configuration>タグ内に次のパラメタを指定します。
簡易構築定義ファイル,および指定するパラメタの詳細は,マニュアル「アプリケーションサーバ リファレンス 定義編(サーバ定義)」を参照してください。
Webクライアントからの同時接続数の制御の設定例について説明します。
次に,リクエスト処理スレッド数の上限が40,接続を拒否するリクエスト処理スレッド数が1の場合の設定例を示します。
: <param> <param-name>webserver.connector.inprocess_http.max_connections</param-name> <param-value>40</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>1</param-value> </param> : |
この設定例では,接続後に同時にリクエストを処理できるWebクライアントの数は39となります。リクエスト処理中のスレッド数が39に達すると,残りの1スレッドはWebクライアントに対してエラーを返し続けます。
Webクライアントからの同時接続数の制御によって,接続を拒否したリクエストに対しては,ステータスコード503(Service Unavailable)のエラーをWebクライアントに返します。このときクライアントに返すエラーページをカスタマイズすると,レスポンスメッセージのカスタマイズや,ほかのサーバへのリダイレクトができます。それぞれの場合の設定例を次に示します。なお,エラーページのカスタマイズについては,「5.15 エラーページのカスタマイズ(インプロセスHTTPサーバ)」を参照してください。
: <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>3</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.list</param-name> <param-value>REJECTION_1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.status</param-name> <param-value>503</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.file</param-name> <param-value>C:/data/busy.html</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.file.content_type=text/html; charset</param-name> <param-value>ISO-8859-1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.request_url</param-name> <param-value>/*</param-value> </param> : |
: <param> <param-name>webserver.connector.inprocess_http.rejection_threads</param-name> <param-value>3</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.list</param-name> <param-value>REJECTION_1</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.status</param-name> <param-value>503</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.redirect_url</param-name> <param-value>http://host1/busy.html</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.error_custom.REJECTION_1.request_url</param-name> <param-value>/*</param-value> </param> <param> : |
All Rights Reserved. Copyright (C) 2012, 2015, Hitachi, Ltd.