{"id":580,"date":"2010-07-01T15:54:53","date_gmt":"2010-07-01T20:54:53","guid":{"rendered":"http:\/\/www.migrate2cloud.com\/blog\/?p=580"},"modified":"2016-03-21T02:51:34","modified_gmt":"2016-03-21T07:51:34","slug":"apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2","status":"publish","type":"post","link":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/","title":{"rendered":"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2"},"content":{"rendered":"<p>Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able to share the part of the traffic.<!--more--><\/p>\n<p>The following documentation will give you a clear picture about how to deploy an Apache-Tomcat Load Balanced setup on Amazon EC2 in such a way that all the sensitive datas are stored in their highly reliable storage solutions like EBS and S3 so that you wont lose your data even if your instance crashes. You can see in the below figure that all the application files, static files and images are stored on EBS and are regularly backed up to s3 by taking snapshots. This can be done by creating softlinks for document root of apache and tomcat ( webapps folder ) or you can change the data directory and <a href=\"http:\/\/www.migrate2cloud.com\/blog\/amazon-ec2-boot-from-ebs\" target=\"_blank\">run it from EBS<\/a>. To see how to run the database from EBS , Please check our article on how to\u00a0 run &#8220;<a href=\"http:\/\/www.migrate2cloud.com\/blog\/postgresql-on-ec2\" target=\"_blank\">PostgreSQL _from_EBS<\/a>&#8221;<\/p>\n<p><a href=\"http:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2010\/07\/diagram-blog.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-592\" title=\"diagram-blog\" src=\"http:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2010\/07\/diagram-blog.jpg\" alt=\"\" width=\"592\" height=\"571\" srcset=\"https:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2010\/07\/diagram-blog.jpg 592w, https:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2010\/07\/diagram-blog-300x289.jpg 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/a><\/p>\n<p>Lets start with the apache-tomcat environment with load-balanced on the local system.<\/p>\n<p style=\"text-align: left;\"><strong>1. Basic Apache-Tomcat Setup<\/strong><\/p>\n<p style=\"text-align: left;\">i) Install tomcat onto the web server.<\/p>\n<p style=\"text-align: left;\">ii) Install the mod_jk module and verify its presence under apache\/modules directory.<br \/>\nEnter the below content to the apache configuration file.<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">LoadModule jk_module modules\/mod_jk-apache-2.2.4.so<\/div>\n<p style=\"text-align: left;\">iii) Now create the worker file named jkworkers.properties under the apache\/conf\/ location.\u00a0 The worker file refers to the workers\u00a0 to whom the apache\u2019s power is to be transferred.<\/p>\n<p>Enter the below content to it:<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.list=worker1<br \/>\nworker.worker1.type=ajp13<br \/>\nworker.worker1.host=localhost<br \/>\nworker.worker1.port=8009<\/div>\n<p style=\"text-align: left;\">iv) Specify the worker file in the apache\u2019s configuration file as given belove<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">JkShmFile &#8220;\/etc\/httpd\/logs\/mod_jk.shm&#8221;<br \/>\nJkWorkersFile &#8220;\/etc\/httpd\/conf\/jkworkers.properties&#8221;<br \/>\nJkLogFile &#8220;\/etc\/httpd\/logs\/mod_jk.log&#8221;<br \/>\n# Select the log format<br \/>\nJkLogStampFormat &#8220;[%a %b %d %H:%M:%S %Y] &#8221;<br \/>\n# JkOptions indicate to send SSL KEY SIZE,<br \/>\nJkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories<br \/>\n# JkRequestLogFormat set the request format<br \/>\nJkRequestLogFormat &#8220;%w %V %T&#8221;<br \/>\nJkMount \/jsp-examples1 worker1<br \/>\nJkMount \/jsp-examples1\/* worker1<\/div>\n<p style=\"text-align: left;\">This tells the apache where to look for the definition of its worker and tells them whenever there is a request for the page named jsp-examples1, the power should hand over\u00a0 to the tomcat instance represented by worker1.<\/p>\n<p>Now restart the apache and the tomcat. Open the browser to access\u00a0 http:\/\/localhost\/jsp-examples1\/.<\/p>\n<p><strong>2. Load Balanced set-up on a single web server<\/strong><\/p>\n<p>We can run more than one tomcat on the single instance. You just need is to follow the steps given below.<\/p>\n<p style=\"text-align: left;\">i) Copy the tomcat folder to a new location named tomcat2. And edit the its server.xml file as given below<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Connector port=&#8221;8080&#8243; maxHttpHeaderSize=&#8221;8192&#8243;<br \/>\nmaxThreads=&#8221;150&#8243; minSpareThreads=&#8221;25&#8243; maxSpareThreads=&#8221;75&#8243;<br \/>\nenableLookups=&#8221;false&#8221; redirectPort=&#8221;8443&#8243; acceptCount=&#8221;100&#8243;<br \/>\nconnectionTimeout=&#8221;20000&#8243; disableUploadTimeout=&#8221;true&#8221; \/&gt;<\/div>\n<p style=\"text-align: left;\">to<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Connector port=&#8221;8019&#8243; maxHttpHeaderSize=&#8221;8192&#8243;<br \/>\nmaxThreads=&#8221;150&#8243; minSpareThreads=&#8221;25&#8243; maxSpareThreads=&#8221;75&#8243;<br \/>\nenableLookups=&#8221;false&#8221; redirectPort=&#8221;8443&#8243; acceptCount=&#8221;100&#8243;<br \/>\nconnectionTimeout=&#8221;20000&#8243; disableUploadTimeout=&#8221;true&#8221; \/&gt;<\/div>\n<p>and,<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Connectort port=\u201d8009\u201d enbaleLookups=\u201dfalse\u201d redirectPort=\u201d8443\u201d protocol=\u201dAJP\/1.3\u201d \/&gt;<\/div>\n<p>to<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Connectort port=\u201d8010\u201d enbaleLookups=\u201dfalse\u201d redirectPort=\u201d8443\u201d protocol=\u201dAJP\/1.3\u201d \/&gt;<\/div>\n<p>Also change the port number from<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Server port=&#8221;8006&#8243; shutdown=&#8221;SHUTDOWN&#8221;&gt;<\/div>\n<p>to<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Server port=&#8221;different port number but greater than 1024&#8243; shutdown=&#8221;SHUTDOWN&#8221;&gt;<\/div>\n<p style=\"text-align: left;\">ii) Now add the below contents to the jkworkers file<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.list=worker2<br \/>\nworker.worker2.type=ajp13<br \/>\nworker.worker2.host=localhost<br \/>\nworker.worker2.port=8010<\/div>\n<p style=\"text-align: left;\">iii) Open the apache configuration file and add the below contents too.<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">JkMount \/jsp-examples2 worker2<br \/>\nJkMount \/jsp-examples2\/* worker2<\/div>\n<p>Start the tomcat2 and open the browser to access the tomcat home page through link http:\/\/localhost:8019. Then try the link http:\/\/localhost\/jsp-examples2\/<\/p>\n<p style=\"text-align: left;\"><strong>3. LoadBalanced\u00a0 Setup with cluster of tomcat instances<\/strong><\/p>\n<p style=\"text-align: left;\">We have setup two tomcats on a single instance. Now lets see how we set these tomcats to perform load balancing.<\/p>\n<p style=\"text-align: left;\">i) Change the jkworkers.properties file as given below<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.list=workers<br \/>\nworker.worker1.type=ajp13<br \/>\nworker.worker1.host=localhost<br \/>\nworker.worker1.port=8080<br \/>\nworker.worker1.lbfactor=1<br \/>\nworker.worker2.type=ajp13<br \/>\nworker.worker2.host=localhost<br \/>\nworker.worker2.port=8019<br \/>\nworker.worker2.lbfactor=1<br \/>\nworker.workers.type=ajp13<br \/>\nworker.workers.balance_workers=worker1, worker2<br \/>\nworker.workers.lbfactor=1<\/div>\n<p style=\"text-align: left;\">ii) Comment out the JkMount specified before in the apache configuration file and enter the below content to it.<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">JkMount \/jsp-examples workers<br \/>\nJkMount \/jsp-examples\/* workers<\/div>\n<p>Try to access the link http:\/\/localhost\/jsp-examples in your browser. (Please make sure the folder named jsp-examples are present under both the tomcat1 and tomcat2. If not just create it.)<br \/>\nThe page will be provided by either of the tomcat1 or tomcat2. This can be verified by editing any one of the file under jsp-examples folder.<\/p>\n<p>Now lets run these tomcats on different instances say instance1 and instance2, and the apache with mod_jk running on different instance. Here we have total of three instances.<\/p>\n<p style=\"text-align: left;\">To perform the load balancing in this setup, you just need is to change the worker file present on the web server as given below:<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.list=workers<br \/>\nworker.worker1.type=ajp13<br \/>\nworker.worker1.host=\u201dip of instance1\u201d<br \/>\nworker.worker1.port=8080<br \/>\nworker.worker1.lbfactor=1<br \/>\nworker.worker2.type=ajp13<br \/>\nworker.worker2.host=\u201dip of instance2\u201d<br \/>\nworker.worker2.port=8080<br \/>\nworker.worker2.lbfactor=1<br \/>\nworker.workers.type=ajp13<br \/>\nworker.workers.balance_workers=worker1, worker2<br \/>\nworker.workers.lbfactor=1<\/div>\n<p>Make sure that java and tomcat is installed on both the tomcat instances and also check for the folder named js-examples under their webapps folder. Now try to access http:\/\/localhost\/js-examples<br \/>\nHere the page will be provided by either of the tomcat instances.<br \/>\nWhen we are using more than one workers as mentioned in the above workers file, we\u00a0 must set the domain property for each so that the mod_jk sends the request to the respective tomcat instances.<\/p>\n<p style=\"text-align: left;\">Just edit the server.xml files of each tomcat as shown below:<br \/>\nFor the tomcat running on first instance<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Engine name=&#8221;Catalina&#8221; defaultHost=&#8221;localhost&#8221; jvmRoute=&#8221;jvm1&#8243;&gt;<\/div>\n<p>and for the second tomcat running in the other instance<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Engine name=&#8221;Catalina&#8221; defaultHost=&#8221;localhost&#8221; jvmRoute=&#8221;jvm2&#8243;&gt;<\/div>\n<p>Now edit the workers file in the apache server and add the line given below:<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.worker1.domain=jvm1<br \/>\nworker.worker2.domain=jvm2<\/div>\n<p>So that the worker file will look like:<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">worker.list=balancer<br \/>\nworker.worker1.domain=jvm1<br \/>\nworker.worker1.type=ajp13<br \/>\nworker.worker1.host=\u201dip of instance1\u201d<br \/>\nworker.worker1.port=8080<br \/>\nworker.worker1.lbfactor=1<br \/>\nworker.worker2.domain=jvm2<br \/>\nworker.worker2.type=ajp13<br \/>\nworker.worker2.host=\u201dip of instance2\u201d<br \/>\nworker.worker2.port=8080<br \/>\nworker.worker2.lbfactor=1<br \/>\nworker.balancer.type=ajp13<br \/>\nworker.balancer.balance_workers=worker1, worker2<br \/>\nworker.balancer.lbfactor=1<br \/>\nworker.balancer.sticky_session=1<\/div>\n<p>Here we have setup a sticky session with load balance. If any of the two instances gets crashed then the request is passed to the third tomcat which is working properly. If the tomcats get back to the working state then the request will be accepted by the any one of the working tomcats.<br \/>\nThe sticky session on the above worker file checks whether the requests with the session ID\u2019s should be routed back to the same tomcat. If the sticky session is set true or 1, the session is set sticky.<\/p>\n<p><strong>4. Persistent Session Manager with a shared file store<\/strong><\/p>\n<p>Presistent session is generally used for uninterrupted flow of session when tomcat servers get crashed or restart properly. To setup this session manager first we have to comment out the \u201c&lt;cluster&gt;\u201d element in each instance. Then add the below content to the content.xml file.<\/p>\n<div style=\"padding: 0.7em; border: 1px dashed #2f6fab; margin: 5px; background-color: #f9f9f9; font-family: arial, verdana, sans-serif; font-size: 13px; color: #000000;\">&lt;Context&gt;<br \/>\n&lt;Manager className=&#8221;org.apache.catalina.session.PersistesntManager&#8221;&gt;&lt; Store className-&#8220;org.apache.catalina.session.FileStore&#8221;&gt;<br \/>\ndirectory=&#8221;cluster shared directory&#8221;\u00a0\u00a0 &lt;!&#8211; the path of the directory shared by the tomcat cluster &#8211;&gt;<br \/>\n\/&gt;<br \/>\n&lt;\/Manager&gt;<br \/>\n&lt;\/Context&gt;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3],"tags":[558,567,4,235,246,511,485,20,562,215,260,144,557,137,6,560,444,483,484,564,44,568,559,561,566,77,43,565,563,40,204,233,138],"class_list":["post-580","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","tag-properties","tag-server-port","tag-amazon","tag-amazon-elastic-compute-cloud","tag-apache-http-server","tag-apache-server","tag-apache-tomcat","tag-aws","tag-catalina","tag-cloud-infrastructure","tag-company-technology","tag-company-amazon-com","tag-configuration-files","tag-department-stores-nec","tag-ec2","tag-heavy-java-applications","tag-java","tag-java-enterprise-platform","tag-java-platform","tag-jsp","tag-load-balancing","tag-manager-classname","tag-mod-jk","tag-persistent-session-manager","tag-session-manager","tag-ssl","tag-sticky-session","tag-storage-solutions","tag-store-classname","tag-tomcat","tag-web-server","tag-web-services","tag-xml"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"admin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Migrate to Cloud - we make the clouds rain\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud\" \/>\n\t\t<meta property=\"og:description\" content=\"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2010-07-01T20:54:53+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-03-21T07:51:34+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#blogposting\",\"name\":\"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud\",\"headline\":\"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2\",\"author\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/admin-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/07\\\/diagram-blog.jpg\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#articleImage\",\"width\":592,\"height\":571},\"datePublished\":\"2010-07-01T15:54:53-05:00\",\"dateModified\":\"2016-03-21T02:51:34-05:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#webpage\"},\"articleSection\":\"Cloud computing, .properties, &lt;Server port, amazon, Amazon Elastic Compute Cloud, Apache HTTP Server, apache server, Apache Tomcat, aws, Catalina, Cloud infrastructure, Company Technology, Company: Amazon.com, Configuration files, Department Stores - NEC, EC2, heavy java applications, Java, Java enterprise platform, Java platform, jsp, load balancing, Manager className=, Mod jk, Persistent Session Manager, session manager, SSL, sticky session, storage solutions, Store className-, tomcat, web server, Web services, XML\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"name\":\"Cloud computing\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"position\":2,\"name\":\"Cloud computing\",\"item\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#listItem\",\"name\":\"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#listItem\",\"position\":3,\"name\":\"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"name\":\"Cloud computing\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\",\"name\":\"Migrate to Cloud\",\"description\":\"we make the clouds rain\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/admin-2\\\/#author\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/admin-2\\\/\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d370c5f82d8ed54ea2a14d7d135705e3add3103f5fa9b7670bd9dc6335a92e9e?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"admin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#webpage\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/\",\"name\":\"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud\",\"description\":\"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/admin-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/admin-2\\\/#author\"},\"datePublished\":\"2010-07-01T15:54:53-05:00\",\"dateModified\":\"2016-03-21T02:51:34-05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/\",\"name\":\"Migrate to Cloud\",\"description\":\"we make the clouds rain\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud","description":"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able","canonical_url":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#blogposting","name":"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud","headline":"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2","author":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/admin-2\/#author"},"publisher":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2010\/07\/diagram-blog.jpg","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#articleImage","width":592,"height":571},"datePublished":"2010-07-01T15:54:53-05:00","dateModified":"2016-03-21T02:51:34-05:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#webpage"},"isPartOf":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#webpage"},"articleSection":"Cloud computing, .properties, &lt;Server port, amazon, Amazon Elastic Compute Cloud, Apache HTTP Server, apache server, Apache Tomcat, aws, Catalina, Cloud infrastructure, Company Technology, Company: Amazon.com, Configuration files, Department Stores - NEC, EC2, heavy java applications, Java, Java enterprise platform, Java platform, jsp, load balancing, Manager className=, Mod jk, Persistent Session Manager, session manager, SSL, sticky session, storage solutions, Store className-, tomcat, web server, Web services, XML"},{"@type":"BreadcrumbList","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.migrate2cloud.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","name":"Cloud computing"}},{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","position":2,"name":"Cloud computing","item":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#listItem","name":"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#listItem","position":3,"name":"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2","previousItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","name":"Cloud computing"}}]},{"@type":"Organization","@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization","name":"Migrate to Cloud","description":"we make the clouds rain","url":"https:\/\/www.migrate2cloud.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/admin-2\/#author","url":"https:\/\/www.migrate2cloud.com\/blog\/author\/admin-2\/","name":"admin","image":{"@type":"ImageObject","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d370c5f82d8ed54ea2a14d7d135705e3add3103f5fa9b7670bd9dc6335a92e9e?s=96&d=mm&r=g","width":96,"height":96,"caption":"admin"}},{"@type":"WebPage","@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#webpage","url":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/","name":"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud","description":"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/#breadcrumblist"},"author":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/admin-2\/#author"},"creator":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/admin-2\/#author"},"datePublished":"2010-07-01T15:54:53-05:00","dateModified":"2016-03-21T02:51:34-05:00"},{"@type":"WebSite","@id":"https:\/\/www.migrate2cloud.com\/blog\/#website","url":"https:\/\/www.migrate2cloud.com\/blog\/","name":"Migrate to Cloud","description":"we make the clouds rain","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Migrate to Cloud - we make the clouds rain","og:type":"article","og:title":"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud","og:description":"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able","og:url":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/","article:published_time":"2010-07-01T20:54:53+00:00","article:modified_time":"2016-03-21T07:51:34+00:00","twitter:card":"summary_large_image","twitter:title":"Apache-Tomcat Load Balanced Persistent Session Setup on Amazon EC2 - Migrate to Cloud","twitter:description":"Although Tomcat is a good option for heavy java applications, it gives a poor performance under high pressure.The best way to solve this problem is to set up an Apache-Tomcat Load Balanced on your Amazon EC2 environment. In this case you will have more than one parallel running tomcat instances and each will be able"},"aioseo_meta_data":{"post_id":"580","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2022-12-27 09:15:40","updated":"2026-07-21 15:27:08","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.migrate2cloud.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/\" title=\"Cloud computing\">Cloud computing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tApache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.migrate2cloud.com\/blog"},{"label":"Cloud computing","link":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/"},{"label":"Apache-Tomcat Load Balanced Persistent Session  Setup on Amazon EC2","link":"https:\/\/www.migrate2cloud.com\/blog\/apache-tomcat-load-balanced-persistent-session-setup-on-amazon-ec2\/"}],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":30,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":2164,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions\/2164"}],"wp:attachment":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}