1 / 18

Load Balance of Tomcat with Apache

Load Balance of Tomcat with Apache. by George Fu, UCCS CS 526 Semester Project Spring 2009. Outline. Our webserver system introduction HTTP Load balancing on Solaris The work I did Future work Conclusions References . Internet. Our Current Web Servers on Solaris. Client. Problems.

faxon
Download Presentation

Load Balance of Tomcat with Apache

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Load Balance of Tomcat with Apache by George Fu, UCCS CS 526 Semester Project Spring 2009

  2. Outline • Our webserver system introduction • HTTP Load balancing on Solaris • The work I did • Future work • Conclusions • References

  3. Internet Our Current Web Servers on Solaris Client

  4. Problems • No Load Balance • Single Point of Failure • No Transparent Failover and Failback • No Scalability • Performance • Low Availability

  5. Resolutions on Solaris • Hardware based load balancing • Reverse proxy:mod_proxy, mod_jk, mod_cluster • Load balancing appliance (Juniper, Cisco…) • Tomcat balancer application • DNS load balancing (Round Robin)

  6. Mod_Cluster Blancer • Allows httpd to act as a load balancer in front of Tomcat based-based webservers • JBoss Product • Very little configuration on the httpd side • Main calculations done on the backend servers • Backend server dynamic configuration • No more workers.properties

  7. Mod_Proxy Blancer • Part of mod_proxy • New in Apache HTTP Server 2.2 • Two load balancing methods • By number of requests • By number of bytes • Detects failed backends

  8. Apache mod_proxy Configuration • Listen 80 • LogLevel debug • TransferLog logs/access_log • LoadModule proxy_module modules/mod_proxy.so • LoadModule proxy_http_module modules/mod_proxy_http.so • LoadModule proxy_balancer_module modules/mod_proxy_balancer.so • ProxyPass / balancer://mycluster/ • ProxyPassReverse / http://1.2.3.4:80 • ProxyPassReverse / http://1.2.3.5:80 • <Proxy balancer://mycluster> • BalancerMember http://1.2.3.4:80 • BalancerMember http://1.2.3.5:80 • </Proxy>

  9. Tomcat and mod_jk • Apache + mod_jk • Multiple tomcat servers • Balancer worker • Very easy to do

  10. Apache Worker-Properties File • worker.list=loadbalancer worker.tomcat1.port=18081 worker.tomcat1.host=localhost worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=1 worker.tomcat2.port=28081 worker.tomcat2.host=localhost worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1, tomcat2 worker.loadbalancer.method=Busyness

  11. Apache httpd.conf File • JkMount /jsp-examples loadbalancer JkMount /jsp-examples/* loadbalancer

  12. Tomcat server.xml File • <Engine name="Standalone" defaultHost="localhost" debug="0"> with: <Engine jvmRoute="tomcat1" name="Standalone" defaultHost="localhost" debug="0"> • <Server port="8009" with: <Server port="18081"

  13. Our Webservers with Load Balancer

  14. Future Work • Problem: Single point of failure • DNS round-robin • No work at the server side • Multiple records in DNS zone file

  15. Example DNS Zone File scalingout.org. 86400 IN SOA ns.scalingout.org. sctemme.scalingout.org. ( 2006051401 ; Serial 86400 ; refresh (1 day) 7200 ; retry (2 hours) 8640000 ; expire (10 days) 86400 ) ; minimum (1 day) scalingout.org. IN NS bagheera.scalingout.org. gw IN A 10.11.0.1 bagheera IN A 10.11.0.2 ; ... mail IN CNAME bagheera ns IN CNAME bagheera www IN A 10.11.0.113 IN A 10.11.0.114 IN A 10.11.0.115

  16. DNS Round-Robin :

  17. Conclusions • Apache/Tomcat load balancing is easy • No dedicated balancer machine is needed • For better performance, mod_cluster can be used

  18. References • Aveneet Manget, Load-balancing Tomcat with Apache, 2008 http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=LoadBalancingTomcatApacheWeb • Brain Stansberry, A new httpd-based load balancer http://www.jugs.ch/html/events/slides/090313_BrianStansberry_mod-cluster-jug.pdf • Apacheand Tomcat load balancing http://confluence.atlassian.com/display/DOC/Apache+and+Tomcat+load+balancing

More Related