リトライ可能か否か(ピアがメッセージの処理を開始した否か)を判別するには、より細かな情報交換を行う別種のプロトコルを採用しても良いが、複雑なプトロコルはパフォーマンスに悪影響を及ぼす可能性が高いので避けたいところである。
というわけで、以下本題。
pipeliningを行わないHTTP/1.1のような単純なリクエスト/レスポンス型プロトコルをそのままに、アプリケーションレイヤへのリクエスト到達可否を判定する手軽な方法としては、SO_LINGERを用いる方法がある。具体的には、以下のような形式でサーバを実装する。
while (1) { receive_request(); use_RST_for_close(); // SO_LINGERを使い、RSTで切断するよう設定 handle_request(); send_response(); use_graceful_close(); // SO_LINGERを使い、graceful closeを行うよう設定 }クライアントサイドでは、リクエスト送信後にEPIPE(write(2)の場合)かECONNRESET(read(2)の場合)を受け取った場合のみ、リクエストを再送すればよい。
別解としては、サーバが接続を切断する際に「HTTP/1.1 599 Going Away」のようなレスポンスを(たとえリクエストを受信していなくとも)送信するという方法が考えられる(この場合はlingering closeを行わない)。クライアントは、サーバからこのレスポンスを受信した場合のみ、リクエスト再送を行えば良い。
追記: H2Oでは後者の方式をサポートしようかと考えている。そうすれば「Docker と SO_REUSEPORT を組み合わせてコンテナのHot Deployにチャレンジ - blog.nomadscafe.jp」で挙げられているようなデプロイ手法において、(例示されている常にリトライする方法とは異なり)安全なホットデプロイが実現可能になる。
注: パイプライン処理については行わない前提で考える
Thank you for another fantastic posting. Where else could anyone get that kind of information in such a perfect way of writing? I have a speech next week, and I was looking for more info.
ReplyDeleteFRIV 2 | Juegos Friv | Friv 2 Planet | Play Friv 2 Games
Juegos Friv - La Mejor Colección de Juegosfrivol
Friv 4 Games - Friv 400 School for Kids
Coach Outlet ED Hardy Outlet Coach Outlet Store Online Kate Spade Outlet Cheap Jordans Coach Purses Coach Outlet Kate Spade Outlet Toms Outlet Louis Vuitton
ReplyDeleteشركة نقل عفش بجدة
ReplyDeleteشركة نقل عفش بالقصيم
شركة نقل عفش بتبوك
شركة نقل عفش بحفر الباطن
ReplyDeleteشركة نقل عفش
اهم شركات مكافحة حشرات بالخبر كذلك معرض اهم شركة مكافحة حشرات بالدمام والخبر والجبيل والخبر والاحساء والقطيف كذلك شركة رش حشرات بالدمام ومكافحة الحشرات بالخبر
شركة مكافحة حشرات بالدمام
شركة تنظيف خزانات بجدة الجوهرة من افضل شركات تنظيف الخزانات بجدة حيث ان تنظيف خزانات بجدة يحتاج الى مهارة فى كيفية غسيل وتنظيف الخزانات الكبيرة والصغيرة بجدة على ايدى متخصصين فى تنظيف الخزانات بجدة
شركة تنظيف خزانات بجدة
شركة كشف تسربات المياه بالدمام
شركة نقل عفش واثاث
technosizzle
ReplyDeletePet Probiotic Probiotics for dogs Probiotics for cats Does your pet have diarrhea; stinky gas or bad breath Get effective relief with Pet Flora Probiotic Advanced Probiotics for Dogs Cats helps Skin Allergies
ReplyDeletePet Pharmacy Petmeds and Pet Medicine Store Petsability is the Best Online Pet Pharmacy that provides Petmeds Pet Medicine Find Natural Medicines
ReplyDeleteTop 12 Fastest Trains in the World Here are the world’s fastest trains in commercial service, ranked by their operating speed Top 12 Fastest Trains in the World
ReplyDeleteRijschool den haag Hofstad rijopleiding is écht gevestigd in Den Haag Wij helpen je met het behalen van je autorijbewijs na je rijexamen leer je pas echt autorijden Wij helpen je een heel eind op weg om het verkeer in Den Haag én in Nederland de baas te zijn Wij gaan voor kwalitatief rijden!
ReplyDeleteHey Thanks for sharing this valuable information with us. I will come back to your site and keep sharing this information with us.
ReplyDeleteBest Regards - www.office.com/setup
www.office.com/setup
www.office.com/setup
Webroot.com/safe is a protection software solution that communicates with the cloud avoiding the hassle to manage the signature updates to deploy. for office setup visit office.com/setup
ReplyDeleteBanner Design Service is a focusing fact for any kinds of business institutions. Banner show your products identity which is provided by you. Manage your banner design service creatively by any professional designer to highlight your products. Creative banner grabs your customer’s attention.
ReplyDeleteClipping path is a must for any kinds of product images. Clipping Path Service can provide you with your desired product with a high-end view which will help you to attract both the organic customers and paid to add customers. Do clipping path for your business growth and show your customers what you have!
ReplyDeleteGet essay help Toronto in your essay from studentsassignmenthelp.com. It offers 10% discount and free revision service on your first registration.
ReplyDelete