upstream的分发策略

  • A+
所属分类:运维教程

除此之外,upstream还有其它的分配策略,分别如下:

weight

指定轮询几率,weight和访问的比率成正比,用于后端服务器性能不均的情况。如下所示,192.68.18.251的访问比率要比192.168.18.252的访问比率高一倍。

  1. upstream birdteam {
  2. server 192.68.18.251 weight=10;
  3. server 192.168.18.252 weight=5;
  4. }

ip_hash

每个请求按访问ip的hash结果分配,这样每一名访客都会固定访问一个后端服务器,可以解决session的问题。

  1. upstream birdteam {
  2. ip_hash;
  3. server 192.168.18.251;
  4. server 192.168.18.252;
  5. }

fair

按后端服务器的响应时间来分配请求,响应时间短的优先分配。与weight分配策略类似。

  1. upstream birdteam {
  2. fair;
  3. server 192.168.18.251;
  4. server 192.168.18.252;
  5. }

url_hash

按照访问url的hash结果来分配请求,使每个url定向到同一个后端的服务器,后端的服务器为缓存时比较有效。

注意:在upstream中加入hash语句,server语句中不能写入weight等其它参数,hash_method是使用的hash算法。

  1. upstream birdteam {
  2. hash $request_uri;
  3. hash_method crc32;
  4. server 192.168.18.251;
  5. server 192.168.18.252;
  6. }
  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:78   其中:访客  78   博主  0

    • avatar Stanley Allscheid

      As far as summertime sport goes, camping can be a really exciting process for the whole loved ones. Kids will be taught to really like mother nature and adults can get a breath of fresh air away from the metropolis lifestyle. This post will give attention to some wonderful suggestions that will make your following outdoor camping vacation a hit! Reserve your area at the campground at the earliest opportunity. Especially in the summer season, so many people are interested in camping because of their families. If you make your reservation in the wintertime, you will be more likely for top level rate possible. All those price savings can result in extra household enjoyable during your getaway. Whilst a campfire produces adequate lighting from the general area surrounding it, you wish to make sure to acquire along a flashlight on your camping outdoors vacation if you are planning to enterprise away from the campfire’s glow. This is a distinct security provision you don’t desire to ignore. It can be rather dark on the market from the forests at nighttime. A big issue with lots of people that go camping may be the little bugs. Do not get stuck during no place without having some form of bug repellant. Look at your area just before establishing camp out for almost any wasp nests or ant hillsides that could cause you issues. Dress in long pants and very long-sleeved anytime you can and check out on your own for ticks occasionally. Notably, if you have young children, you should look at what you can do if you have bad climate a day. Accumulate jointly several items to possess available just in case you need in which to stay your tent. Provide a table game, enjoy doh and art work supplies. Don’t enable your household people feel these things until finally it down pours so they don’t drop their attractiveness. As was reported in the beginning on this post, quite a lot of preparing needs to be done prior to heading out on a camping journey. The ideas offered in the following paragraphs is a terrific way to make sure that you’ve taken care of all the essentials which means your camping out trip will probably be as safe and enjoyable as you possibly can.

      • avatar piano chords free

        Hello, I desire to subscribe for this web site to obtain most up-to-date updates, therefore where can i do it please help out.|

        • avatar Sidney Nebel

          Camping out is an practical experience that appeals to many people, and the high number of outdoor reality demonstrates is contributing to the appeal. In case you are all set to go outdoor camping, browse the post listed below for tips that will make your trip a special a single. If you are intending backcountry camping, you must possibly have a snake nibble system in your products. The ideal snake nibble kits are the type designed to use suction power. Some packages have scalpels and the flow of blood constrictors in them. Scalpels may actually minimize the poison in to the blood faster, and constrictors could be lethal or even employed properly. In case you are camping outdoors with a community camping site, ensure you package shower area shoes for everybody in your celebration. Not simply will they safeguard the feet through the germs about the shower surface, however are perfect for all those nighttime goes towards the bushes when you should employ the restroom. They could be aged turn flops, Crocs, and even fall-ons. Keep no trace of your own getaway at your campsite, for environmental motives and also as a good manners to park authorities who tidy up and also the next camping out team. Make certain all trash can is found, you re-fill holes you could have dug and of course, that your particular campfire is totally out! Get a resting case which is warm ample. This is very important. Although you may go camping outdoors inside the summertime, nights can get very frosty outside in the crazy. You can find slumbering hand bags promising protection from diverse frosty temperature ranges it is advisable to go for as low a heat that you can find. Camping out provides just about anybody the opportunity peacefully commune with the outdoors. But, so that you can have the kind of practical experience you truly need, it is required to use a specific standard of being familiar with and know-how. With any fortune, the direction contained above provides the building blocks every camper needs to have a fantastic backyard practical experience.

          • avatar web hosting service

            Inspiring story there. What occurred after? Good luck!

            • avatar web development

              An outstanding share! I’ve just forwarded this onto a friend who had been conducting a little research on this. And he actually ordered me breakfast because I found it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanx for spending some time to talk about this matter here on your web site.|

              • avatar Merri Scharmann

                With an abundance of traveling tutorials on the market, it really is challenging to examine all the various guidebooks, literature and resources. The good news is, this post is filled with helpful information that can make your next vacation a great one particular. When traveling, if you have to utilize a open public computer for anything, regardless of whether it’s to check your e mail, your Facebook or twitter, or maybe your banking accounts, be sure you log out! Don’t just close the internet browser such as you may do in your computer, be sure to click the log out switch. This can stop other people from accessing your computer data. For risk-free vacationing, don’t have your belongings in one place. No one wants to manage absent items although on a journey, but if you do have to, it’s better to minimize reduction. Put your a credit card, funds, expensive jewelry, and other things you worth in a number of diverse areas — some with your handbag, some in the bank, some within your pocket, etc. Like that even if anything will get robbed or shed, you most likely won’t lose every thing. Make your funds in your top bank account when running around in a new city or area. It is actually far simpler for the select bank account or some other illegal to snatch dollars away from your back budget without the need of you even recognizing it. Having your funds at the front will give you additional control, particularly if you walk along with your hands in your pockets. One of the ways to handle the tedium to be away from your family members due to operate-related travel is always to make use of the time on your own. Generally, events stop at 5 and you’ll have till the next morning hours. Use the world’s longest bath, and utilize up all of the toiletries. See about three movies in a row. Create individuals few actual snail-email words you always said you would probably, but haven’t got time. Knit a cap. Read through a book. Simply speaking, do all of the great stuff yourself that you simply wouldn’t take time to do if you were flanked by your family. You’ll feel great being aware of you spent the time, and you’ll be very much more happy and much more relaxed if you notice your family members yet again. By heading on the web anybody can entry a lot of information concerning exactly where the initial one is traveling and approximately the region the first is going. Exploring community attractions can help a single pre-plan their journey before it even commences. Using a prepare set up and knowledge around the location can cause a more pleasurable encounter. Through taking time now to get ready for your upcoming trip, you save yourself lots of trouble and migraines that you may be familiar with. Putting the following tips and suggestions to great use will allow you to possess a great time travelling without having contemplating whether or not you remaining the range on.

                • avatar Willa Sharley

                  Touring is something all of us do every once in awhile. It is often necessary for equally business and pleasure. Generating travelling less difficult is actually a objective that many of us have. On this page we shall go over a few recommendations for making the next travel encounter a simpler one particular. Handling airports is surely an regrettable need for very much contemporary travel. Load up an empty normal water bottle to fill up as soon as you get through safety. This could help you save from needing to purchase a $3.00 bottle water when you survive through the checkpoint. It also in no way is painful to pack granola cafes, banana chips, or another type to snack on among journeys. When you are travelling light-weight and about to rinse washing laundry as you go, make use of your day-to-day bath as the opportunity to rinse your underwear and in many cases your light in weight tee shirt. It takes only a few occasions and stops you from building up a heap of laundry washing that must be rinsed at the same time. When organising a highway trip, don’t forget to budget for the cost of energy. Although additional fees can be simply measured beforehand, the cost of petrol is far more hard to physique, and might also add up amazingly quickly. On the internet petrol calculators can show you the location where the least expensive prices are and assist you in getting a solid idea of what you’ll be paying. Tip your concierge! Whether it be on a vacation cruise or at the resort, your concierge will probably be your go-to man for reservations, directions and all sorts of things more! Numerous concierges have accepted that if someone is ready to idea them well, they may fall out of their way to be certain all those great tippers, possess a wonderful time. Traveling is essential for organization and enjoyment also. It is often hard to understand airport terminals, figure routes for auto travel, or even understand a tour bus schedule. How can you make journey less difficult, plus more satisfying as well? On this page we have offered a few recommendations which can help. Hopefully they may confirm successful when you want to traveling.

                  • avatar נערות ליווי

                    Saved as a favorite, I really like your web site!|