Saturday, October 5, 2013

A Quick Tour of the Cloud Foundry Router and Sticky Sessions

The Cloud Foundry Router is a key component of the platform that provides:
  • load balancing to multiple instances of applications with a dynamic routing table updated in a fraction of a second every time there is a change in the system
  • sticky session support
  • access log for apps that feeds into an application's Loggregator stream
  • support for Web Socket and other TCP protocols via HTTP Connect
Cloud Foundry has had support for "sticky" sessions in both v1 and v2. This week I had a meeting with a very large technology provider that has been using Cloud Foundry for quite awhile. They had no idea that sticky sessions were supported or how they worked and I realized we should have a better explanation and showcase of this capability. The use-case for this scenario involved a significant performance optimization when using sticky sessions because of user-specific data caching in the warmed-up app instance.

To enable Cloud Foundry sticky sessions all you need to do in the application is set a cookie named JSESSIONID. Java web applications have a history of using a cookie named JSESSIONID when you enable a session with code like request.getSession( true ) and because many Cloud Foundry users run Java apps, the project decided to use JSESSIONID as an indicator that sticky sessions should be used. To use another sticky sessions with another language like Ruby or Node.js, all you need to do is set a cookie named JSESSIONID and Cloud Foundry will attempt to consistently route requests to the same app instance.

I created a simple Java web application to show how this works and I hosted a copy of it on http://sticky-session.cfapps.io. In the first screenshot you can see that sticky sessions are not enabled. First we can see that there are 4 instances of the app running.


Now when we visit the app and use something like Chrome Dev Tools to inspect the app. Refresh the app several times and observe that the printed out port changes as we are load balanced across the multiple app instances.


Now we'll click the "start a sticky session" link in the app, which creates a Java session in Tomcat and creates a JSESSIONID cookie. The router will notice the JSESSIONID cookie and set a Cloud Foundry specific cookie named __VCAP_ID__ with a value of the app instance GUID. The __VCAP_ID__ cookie is the hint to the router to send the request to the specific app instance. With these cookies set, refresh the page and the browser should consistently route to the single app instance.


If you use Chrome Dev Tools to delete the __VCAP_ID__ cookie and refresh the page, and you should see a randomly selected app instance value get set again for __VCAP_ID__. Subsequent page refreshes will be sticky to the instance reflected in the updated __VCAP_ID__ cookie value.

If you are interested in other features for the Cloud Foundry Router, let us know on the Cloud Foundry mailing list.  

1,448 comments:

«Oldest   ‹Older   1401 – 1448 of 1448
Cindypagita said...

Bandar poker Terpercaya
Bandar poker Terpercaya
Bandar poker Terpercaya
Bandar poker Terpercaya
Bandar poker Terpercaya

Bandar poker Terpercaya
Dewacintaqq
Dewacintaqq.com
Dewa cintaqq
Poker Online
Domino 99
BandarQ
link alternatif Dewacintaqq
Daftar Dewacintaqq

Bandar poker Terpercaya
dewacintaqq
dewacintaqq.com
dewa cintaqq
Cinta
daftar dewacintaqq
link alternatif dewacintaqq

Bandar poker Terpercaya
Bandar poker Terpercaya

SITUS TOGEL ONLINE
Situs Togel Hongkong
Situs Togel Singapore

Bandar poker terpercaya
Daftar Dominohalo

Bandar poker terpercaya
Daftar twinpoker88

Bandar poker terpercaya
Daftar Delimapoker

Bandar poker terpercaya
Daftar Papadomino

DewacintaQQ
link alternatif Dewacintaqq
Deposit
Deposit dewacintaqq
Poker Indonesia
Poker Online Indonesia
Bandar QQ
Agen Ceme Online
Daftar Situs Poker
Poker Online Terpercaya
Judi Poker
Poker Online Uang Asli
Poker Uang Asli
Situs Poker Online
Agen Poker
Poker88
Capsa Susun Online
daftar idn poker
idnpoker
bigceme
ceme
ceme online
bandar ceme
idn poker
Idnplay
idn play
poker
poker idn
agen poker online
poker online
situs poker online
judi online
situs judi online


Cindypagita said...

dewacintaqq
Bandar poker terpercaya
Poker Indonesia
Poker Online Indonesia
Agen Ceme Online
Daftar Situs Poker
Poker Online Terpercaya
Judi Poker
Poker Online Uang Asli
Poker Uang Asli
Situs Poker Online
Agen Poker
Situs Judi Online Terpercaya
bandar poker
situs judi
poker online
ceme online
bandar ceme
situs poker
bandar judi
poker idn
judi poker
judi online
agen judi
bandar judi
poker idn
agen poker
idn poker
Situs Judi Poker Online
DominoQQ IDN POKER
Agen judi kartu deposit uang asli pkv
games
poker online
dominoqq
bandarqq
bandar poker
bandarq
sakong
aduq
capsa susun
Perang bacarat
-------------------------------------------------------------------------------------------
Daftar Dominohalo
Bandar poker terpercaya
judi poker online
bandar poker online
judi online
poker online
dominoqq
situs judi online
situs poker online
-----------------------------------------------------------------------------------------
Daftar twinpoker88
Bandar poker terpercaya
judi online
situs judi online
poker online
dominoqq
bandarqq
bandar poker
bandarq
sakong
aduq
capsa susun
-----------------------------------------------------------------------------------
Daftar Delimapoker
Bandarq online terpercaya
Delimapoker situs resmi daftar judi online bandar poker
bandar66
sakong
capsa
domino99
aduq uang asli qq online domino QQ
bandarq
judi online
bandar poker
qq online
----------------------------------------------------------------------------------
Daftar Papadomino
Bandar poker terpercaya
situs judi online
judi online
situs poker online
poker online
dominoqq
domino99
bandarq

eTechnoCraft said...

Thanks for sharing your valuable thoughts with us & our readers.

Law Write For Us

eTechnoCraft said...

Nice Post… Thanks for sharing this information.

Online shopping site in India

Ashish said...


Thanks for sharing such a usefull information
https://atlantaplumberrepair.com/

Mortgagequestions said...

Mortgagequestions
Mortgagequestions Login
www.mortgagequestions.com Login
Mortgagequestions.com
Mortgagequestions Bill Payment
Mortgagequestions.com Login
www.Mortgagequestions.com

Roshan Ray said...

Wow !!!! Such a great Post to read and thank you for sharing the knowledge. by Routersly

Roshan Ray said...

Amazing Article worth reading the post. by JustQuikr

Mihir Mane said...

Get updates on bee modelling jobs, freelance singing jobs, freelance makeup artists jobs, freelance anchoring jobs, freelance stylist jobs in India. singing jobs

Golden Slot said...

เกมส์สล็อตออนไลน์ที่ดีที่สุด goldenslot สามารถเข้าไปร่วมสนุกกันได้ที่ ทางเข้า goldenslot

Roshan Ray said...

I read your post it's amazing and I really appreciate your knowledge.
Every Mentioned point is useful and worth to read. Thank You!!!
Loving Hands

abhikhurana said...

Choose gifts from best gifts options this Christmas. Gift your brother, sister, grandma, grandpa, dad with joy and happiness. christmas gifts for parents

sanjupawar said...

Know which are the current viral , trending, top most and latest funny youtube videos, memes going viral. trending india

Data Science Course in Bangalore said...

Actually I read it yesterday I looked at most of your posts but I had some ideas about it . This article is probably where I got the most useful information for my research and today I wanted to read it again because it is so well written.
Data Science Course in Bangalore

archi said...

Under roof get the best convection microwave oven in India under 10000 for your kitchen and
start cooking. best convection microwave oven under 10000

Jane Mistry said...

Cheap SSD Hosting India
Cheap Web Hosting India

Roshan Ray said...

Actually, I read it yesterday I looked at most of your posts but I had some ideas about it. This article is probably where I got the most useful information for my research and today I wanted to read it again because it is so well written.
evoseedbox

Technothon said...

Nice, do you like candies then visit here mouth freshener suppliers in india

top 10 said...

Do Follow New Blog Post on the New Current Running Shows:
American Idol 2021 who will win the Final
American Idol 2021 who will win the Final
American Idol 2021 who will win the Final
AGT 2021 who will win the Final
AGT 2021 who will win the Final
The Voice Australia 2021 AU Vote
The Voice 2021 who will win the Final
American Idol 2021 who will win the Final

georgefernandis said...

Find the best amazing good morning quotes, attitude, love quotes , good night, inspirational and motivational quotes etc in hindi. status in hindi

samgunjan said...

Want to know the best place to know what is digital marketing in hindi. digital marketing in hindi

purvi said...

Visit the website to know about what trp means, trp full form in hindi or trp meaning, visit our
website for details. trp means

Rahul Singh said...

Nice Blog With Full of Knowledge
Thanks For Sharing.. such informative post, I learned a lot from this Post Thank you!!
Check Out SEO Consultant in Mumbai.

Smail Oujaoura said...

معرفة اسم المتصل
تحميل game loop
افلام تورنت

deepotech said...

برنامج تصوير الشاشة

موقع مثل اليوتيوب

naikin sign said...

thank you for the information provided, we are waiting for the next info at cara menggugurkan kandungan

Ashish said...

I Read your blog it is very nice thanks for sharing.

Visit: https://www.makeupcollectionbyterri.com/

Jason Beer said...

Looking for the best seedbox hosting to keep your privacy safe when torrenting? Get Dedicated, VPS, or Shared seedbox at Best Price. Get it from here: Iseedfast

Ashish said...

I really like your blog. Please keep sharing such a nice blogs

Visit:https://www.makeupcollectionbyterri.com/

Book Cheapest Packers and Movers in Delhi, Charges said...

Book Best Movers and Packers in Malviya Nagar Delhi

Packers and Movers in Delhi

Packers and Movers in Bangalore

Packers and Movers Mumbai

Packers and Movers Gurgaon

Packers and Movers South Delhi

rdmedia said...

Mobile Repairing Course In Delhi

Robert said...

bipolar disorder psychiatrist in cleveland

Unknown said...

https://1strateinspections.com/

Unknown said...

when we talk about home inspection houston, the top name that surfaces in front of our eyes in 1st rate inspections because of the extraordinary services they are providing. They are serving Houston, Cypress, Spring, The Woodlands, Katy, Sugar Land and surrounding areas. This company is not only looking for customers but also understands how overwhelming the home buying process can be hence they want to make it easier for you. They have been serving for more than 10 years hence they take pride in being the houston home inspection because of a great amount of positive reviews plus a number of certifications including InterNACHI, CPI and CMI which makes them credible and reliable. Another very prominent feature about their services is that they provide same day reports so that when we walk away from your home, we want you to be satisfied and sure about what next steps you need to take to make your home a safer place for you to live.

Unknown said...

In has a long list of candidates claiming to be the best here. The threats to the health and beauty of a house have resulted in the increased trends towards home inspection. There is a large number of houston home inspectors has but only a few can be trusted as there are many factors that should be considered while hiring a home inspection company or calling a specific home inspector inside your house. The very first thing that should be made sure is that either the company from which you are hiring your services is certified or not. Certifications are very important as they are a proof that the company is reliable and you can trust the home inspector they are sending to your house for the home inspection as many uncertainties have been reported from home owners when it comes to the fact that a complete stranger is coming to their house and going to analyze everything in detail. Good reviews and a keen look at their rating helps a lot as well.

Unknown said...

When it comes to general home inspectors, we need to consider many factors like the company they are associated with, their certifications, the number of home inspections they have completed and the number of positive 5-star reviews they have. It is very important to run a background check on a home inspector houton tx has because there are many companies now in Texas running themselves as home inspection companies consisting of one or more people. With such a huge saturation in the market it is important to know what specifications pool and spa inspections houston should have in order to provide you a good result of a thorough home inspection. We highly recommend you to check the reviews for a friendly behavior of the home inspectors so that you may be able to analyze completely how the inspection is going and what further precautions and safety measures to be taken in order to make the environment inside your house healthy.

Unknown said...

Home inspections have been a very hot topic ever since it was discovered that radon is the second leading cause of lung cancer and the leading cause of lung cancer in non smokers. The presence of radon gas inside the house was inevitable but necessary steps were introduced in order to mitigate the presence and concentration of this gas inside the house. As home inspectors are specifically trained because of the urgency and importance of this matter, we often forget that other than our home, which is the place where we spend most of our time in? Houston property inspections make sure to check and analyze our work spaces or just a property used for commercial purposes and make sure they are safe for people who are working inside the building or have to spend most of their time there. Home inspection Houston Tx is the best one in some companies to analyze such big properties completely, search for places which need our immediate attention and make sure that we are living and working in a safe and healthy environment.

Unknown said...

One very misunderstood fact is that we need a house inspection when sale or purchase of a house is involved. The health and structure is not just important when we are shifting to a new house or selling our old one, it is equally important when we are living in a house and breathing the air present inside it. Why? Because the health o\f the house, the air around it equally affects the residents and can cause many problems in future. home inspectors near me Houston make sure that the place where you are living is free from impurities such as radon, mold, termites etc.

Unknown said...

Mold Inspection Sciences of Houston is a professional mold inspection, mold detection, and mold testing company. We are the premier Mold Inspection Houston

Unknown said...

Our inspectors are certified residential thermographs, and are equipped with infrared thermal imaging cameras to better complete your home mold inspection Mold testing Houston

Unknown said...

Our inspectors are certified residential thermographs and are equipped with infrared thermal imaging cameras to better complete your home mold inspection Mold Inspection Houston TX

Unknown said...

The Building Code Enforcement enforces the City of Houston Construction Codes for both residential Residential Inspection Houston TX Residential Inspection Houston

Unknown said...

When done as part of a real estate transaction termite inspection Termite Inspection services Houston costs in Houston, Texas can vary somewhat. Typically, they range in price from $85 Termite Inspection Houston TX

james said...

Thanks for the detailed article on this topic. I would like to see more such awesome articles from you. Download GBWhatsApp APK

archi said...

Buy the best convection microwave oven under 10000 to 15000. Buy now! best microwave convection oven

archi said...

Purchase the best convection microwave oven in india under 10000 with buyers guide and
review. best convection microwave oven under 10000

Ashish said...

Determine your skin type and then purchase the products. visit https://www.makeupcollectionbyterri.com/

thomas said...

Thanks for sharing this valuable piece of information. Keep sharing more such awesome articles in the future. Goodbye! Download FMWhatsApp APK

«Oldest ‹Older   1401 – 1448 of 1448   Newer› Newest»