Re: Connection pool in a clustered environment
Hi Chris, thanks for the explanations. I just completed a first dirty test and it is actually working fine. I believe I did something wrong on my first trial. I did put the distributable="true" attribute in the Context element of my context file in $CATALINA_BASE/conf/[[enginename]/[hostname]/mywebapp.xml instead of adding the empty element in $CATALINA_BASE/webapps/mywebapp/WEB-INF/web.xml. It seems the former is not working, at least with Tomcat 8.0.32 - Daniel Savard 2016-03-08 15:08 GMT-05:00 Christopher Schultz : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Daniel, > > On 3/8/16 2:27 PM, Daniel Savard wrote: >> I wonder how you handle a pool of connections (not necessarily to >> a database, think about something generic) in a clustered >> environement. > > Generally, there is nothing to be done, here. Each node is considered > completely separate with the exception of trading HttpSession informatio > n. > >> I defined a pool of connections in my application context and I >> did put it in the context with the setAttribute() method. Since >> each instance is doing this, what will happen when an instance is >> shutdown? > > I believe that no context-scoped data is sent between cluster nodes, > so ... nothing will happen. > >> These connections depend on the IP/protocol/port on both sides. >> So, since the instance is down, one party no longer exists. What >> is happening if a take over instance receives an incoming request >> which refers to one of these connections? >> >> Do I have to handle this in my code? Do I have to reinitialize the >> connection pool if such an event happen? > > If your application maintains its own connection pool, then you should > create it with each webapp start and destroy it with each webapp stop. > > I don't think there are any cluster-related issues, here. > > - -chris > -BEGIN PGP SIGNATURE- > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iEYEARECAAYFAlbfMTIACgkQ9CaO5/Lv0PCL5gCguI2eODlB+8Brz9gpjJZGGzpM > jD4An1Nag5xcNN+2vXKq7xpw6H8Gdhg/ > =Gx0w > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Connection pool in a clustered environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel, On 3/8/16 2:27 PM, Daniel Savard wrote: > I wonder how you handle a pool of connections (not necessarily to > a database, think about something generic) in a clustered > environement. Generally, there is nothing to be done, here. Each node is considered completely separate with the exception of trading HttpSession informatio n. > I defined a pool of connections in my application context and I > did put it in the context with the setAttribute() method. Since > each instance is doing this, what will happen when an instance is > shutdown? I believe that no context-scoped data is sent between cluster nodes, so ... nothing will happen. > These connections depend on the IP/protocol/port on both sides. > So, since the instance is down, one party no longer exists. What > is happening if a take over instance receives an incoming request > which refers to one of these connections? > > Do I have to handle this in my code? Do I have to reinitialize the > connection pool if such an event happen? If your application maintains its own connection pool, then you should create it with each webapp start and destroy it with each webapp stop. I don't think there are any cluster-related issues, here. - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlbfMTIACgkQ9CaO5/Lv0PCL5gCguI2eODlB+8Brz9gpjJZGGzpM jD4An1Nag5xcNN+2vXKq7xpw6H8Gdhg/ =Gx0w -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Connection pool in a clustered environment
Hi everyone, I wonder how you handle a pool of connections (not necessarily to a database, think about something generic) in a clustered environement. I defined a pool of connections in my application context and I did put it in the context with the setAttribute() method. Since each instance is doing this, what will happen when an instance is shutdown? These connections depend on the IP/protocol/port on both sides. So, since the instance is down, one party no longer exists. What is happening if a take over instance receives an incoming request which refers to one of these connections? Do I have to handle this in my code? Do I have to reinitialize the connection pool if such an event happen? Regards, - Daniel Savard - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: clustered environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Usair, On 3/1/16 12:00 AM, uzair rashid wrote: > Background,: windows boxes, cms servers, bobj, tomcat servers > 7.057. Distributed landscape. (Clustered) > > Ive configured the server xml for clustering and distributable to > true in the web xml. > > In the cms, we have a Java null pointer exception. At login it > first says page is expired and then once in it gives an > jasperexception.java.lang.nullpointer exception: while trying to > invoke the method > cpm.businessobjects.bip.core.web.appcontext.appweb session > context. Get productlocale () of an object returned . We have no idea what any of that stuff is. > The peculiar thing is, in our production environment, there is > absolutely no issue. Same versions, etc.? > Things, I've tried: > > 1. Matched conf directory to production 2. Deleted tomcat work > directory 3. Restarted tomcat > > Stderr below: > > 2016-02-29 18:00:56 Commons Daemon procrun stderr initialized > > Feb 29, 2016 6:01:03 PM > org.apache.catalina.startup.VersionLoggerListener log > > INFO: Server version:Apache Tomcat/7.0.57 You might want to upgrade if possible. That version of Tomcat is nearly 18 months old. > INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already > defined > > Feb 29, 2016 6:02:16 PM org.apache.catalina.session.StandardManager > doLoad > > SEVERE: IOException while loading persisted sessions: > java.io.EOFException > > java.io.EOFException > > at > java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream. java:2280) > > at > java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputSt ream.java:2749) > > at > java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779) > > at java.io.ObjectInputStream.(ObjectInputStream.java:279) > > at > org.apache.catalina.util.CustomObjectInputStream.(CustomObjectIn putStream.java:56) > > at > org.apache.catalina.session.StandardManager.doLoad(StandardManager.jav a:244) > > at > org.apache.catalina.session.StandardManager.load(StandardManager.java: 202) > > at > org.apache.catalina.session.StandardManager.startInternal(StandardMana ger.java:489) > > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext .java:5501) > > at > org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) > > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase. java:901) > > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877 ) > > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) > > at > org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java :1245) > > at > org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig. java:1895) > > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439 ) > > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) > > at java.util.concurrent.FutureTask.run(FutureTask.java:138) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecu tor.java:886) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor. java:908) > > at java.lang.Thread.run(Thread.java:743) This is Tomcat not being able to read your stored sessions file. Not the issue you are currently reporting, but you might want to get this fixed. > Feb 29, 2016 6:03:12 PM com.sun.faces.config.ConfigureListener > contextInitialized > > INFO: Initializing Mojarra (1.2_16-20110421-1728-SNAPSHOT) for > context '/BOE' > SEVERE: Servlet.service() for servlet equinoxbridgeservlet threw > exception > > java.lang.IllegalStateException: Cannot call sendError() after the > response has been committed > > at > org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade. java:450) > > > at > com.businessobjects.http.servlet.internal.BundlePathAwareServiceHandler. serviceHelper(BundlePathAwareServiceHandler.java:254) Bad state management by the application. No NullPointerExceptions found in the log file. Can you re-state your question? - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlbZ1P4ACgkQ9CaO5/Lv0PDAuQCfdmudJg2VyFtJ+87jBWt0M/nr 1dIAn1ueY0cwmymjbQWfRwdfIYwLNgZq =NKVv -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
clustered environment
Hello Experts Background,: windows boxes, cms servers, bobj, tomcat servers 7.057. Distributed landscape. (Clustered) Ive configured the server xml for clustering and distributable to true in the web xml. In the cms, we have a Java null pointer exception. At login it first says page is expired and then once in it gives an jasperexception.java.lang.nullpointer exception: while trying to invoke the method cpm.businessobjects.bip.core.web.appcontext.appweb session context. Get productlocale () of an object returned . The peculiar thing is, in our production environment, there is absolutely no issue. Things, I've tried: 1. Matched conf directory to production 2. Deleted tomcat work directory 3. Restarted tomcat Stderr below: 2016-02-29 18:00:56 Commons Daemon procrun stderr initialized Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version:Apache Tomcat/7.0.57 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Nov 3 2014 08:39:16 UTC Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server number: 7.0.57.0 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Windows Server 2008 R2 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version:6.1 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JAVA_HOME: d:\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\sapjvm\jre Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 6.1.044 Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor:SAP AG Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: d:\SAP BusinessObjects\tomcat\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: d:\SAP BusinessObjects\tomcat\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.library.path=C:\Windows\SysWOW64\;d:\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: Enterprise Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: XI Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: 4.0\win64_x64\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=d:\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects\tomcat\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=d:\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects\tomcat\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.endorsed.dirs=d:\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects\tomcat\common\endorsed\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dbobj.enterprise.home=d:\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects\SAP Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: BusinessObjects Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: Enterprise Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: XI Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: 4.0\ Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Xrs Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -XX:MaxPermSize=384M Feb 29, 2016 6:01:03 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.awt.headless=true Feb 29, 2016 6:01:03 PM org.apache.catalina
AW: Where should I store my static content in a clustered environment
I will have a load balancer in front of my webservers. A fault tolerant system is not yet requested, so at the moment I do not care about session replication. We expect a number of 5 users of the system in total, as concurrent connections we expect in the worst case a maximum of 5000. The pages as I already said are mainly static but with a few dynamic ones (i.e. jsp-pages) inbetween. These pages are grouped into modules, whereby the size of each module may vary between 10-50 MB of static data. All modules together are currently 4-5GB in size but are expected to grow in the future. Via the upload/remove form I need it mhas to be possible to remove single modules and to upload new modules. I do not need to exchange single files yet. Bjoern > -Ursprüngliche Nachricht- > Von: Bruno Georges [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 23. November 2005 23:01 > An: Tomcat Users List > Betreff: Re: Where should I store my static content in a > clustered environment > > Bjoern > > Do you need some sort of fault tolerant system? > Can you clarify the requierments you have, do you need load > balancing, session sync replication, async replication? > Traffic, SLA, concurrent connections, ... > > All these will have an impact on the choice and design of > your infrastructure. > > Cheers > > Bruno Georges > > Glencore International AG > Tel. +41 41 709 3204 > Fax +41 41 709 3000 > > > - Original Message - > From: "Duan, Nick" [EMAIL PROTECTED] > Sent: 23.11.2005 21:21 > To: "Tomcat Users List" > Subject: RE: Where should I store my static content in a > clustered environment > > A simple solution would be to have all static pages hosted on > an Apache httpd server in front of tomcat clusters. If you > need more performance, just cluster the httpds. Tomcat is not > really designed to server static pages. Apache httpd can > also serve as a LB. In this case, certainly you have to > treat static pages separately from dynamic webapps. In other > words, you can't bundle static pages with your war files. > > ND > > -Original Message- > From: Eickvonder Bjoern [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 23, 2005 4:23 AM > To: users@tomcat.apache.org > Subject: Where should I store my static content in a > clustered environment > > Hi, > > lets start with describing my current task where I would > appreciate any advice from you. > I have to construct a clustered system (with lots of > webservers) that has few dynamic pages but a lot of static > ones, whereby all resources have to be protected by > security-constraints of a webapp (so letting Apache deliver > this content won't work). Moreover there should be the > possibility to upload/delete static components via a web > form. My main problem is now where should I store the static > data (mainly html pages, images, ...; but over 4 GB(!) large > in total)? > > As far as now I'm considering the following solutions: > > 1.) Storing the content within the webapp of each webserver. > This would include that the servers know each other as the > upload/delete operations must be propagated from one server > to all the others. Moreover the update of the dynamic parts > would not be as easy any more as just uploading a new > war-file as this requires deleting the old webapp directory > (that contains the content is this case as well). > > 2.) Storing the content in a separate directory but still on > each webserver. This would still include that servers must > know each other, but updating the dynamic part would be > easier. The downside is that I would have to write a servlet > that delivers all static content with all the problems of > mime-types, character encoding and so on which I would have > to handle myself. > > 3.) Storing the content in a database on a separate server. > The advantage would be that webservers only need to know > their database server and updating the webapps would be easy > (just uploading new war-files). The downside here is that I > need a servlet too and I think it's maybe not the fastest > solution as all requests of all servers to each single chuck > of static content would require a connection to the database server. > > 4.) As 3.) but storing data on a single separate server in > the filesystem. The advantages/disadvantages should be > similar to 3.) whereby I do not know which solution might be faster. > > 5.) As 3.)/4.) but additionally implementing a > caching-mechanism on the webservers. This means if a > webserver gets a request for a specific page for the first > time he connects the databas
AW: Where should I store my static content in a clustered environment
Ok, but then tell me how do I effectively protect each single chunck of data using the servlet security mechanism if the data is not served by tomcat? The problem is that my customer wants every single image, html, pdf and what so ever be directly protected. In other words if someone directly enters a specific url to a pdf for example he should be redirected to a login page (using form based login) unless he is already logged in. Bjoern > -Ursprüngliche Nachricht- > Von: Duan, Nick [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 23. November 2005 21:22 > An: Tomcat Users List > Betreff: RE: Where should I store my static content in a > clustered environment > > A simple solution would be to have all static pages hosted on > an Apache httpd server in front of tomcat clusters. If you > need more performance, just cluster the httpds. Tomcat is not > really designed to server static pages. Apache httpd can > also serve as a LB. In this case, certainly you have to > treat static pages separately from dynamic webapps. In other > words, you can't bundle static pages with your war files. > > ND > > -Original Message- > From: Eickvonder Bjoern [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 23, 2005 4:23 AM > To: users@tomcat.apache.org > Subject: Where should I store my static content in a > clustered environment > > Hi, > > lets start with describing my current task where I would > appreciate any advice from you. > I have to construct a clustered system (with lots of > webservers) that has few dynamic pages but a lot of static > ones, whereby all resources have to be protected by > security-constraints of a webapp (so letting Apache deliver > this content won't work). Moreover there should be the > possibility to upload/delete static components via a web > form. My main problem is now where should I store the static > data (mainly html pages, images, ...; but over 4 GB(!) large > in total)? > > As far as now I'm considering the following solutions: > > 1.) Storing the content within the webapp of each webserver. > This would include that the servers know each other as the > upload/delete operations must be propagated from one server > to all the others. Moreover the update of the dynamic parts > would not be as easy any more as just uploading a new > war-file as this requires deleting the old webapp directory > (that contains the content is this case as well). > > 2.) Storing the content in a separate directory but still on > each webserver. This would still include that servers must > know each other, but updating the dynamic part would be > easier. The downside is that I would have to write a servlet > that delivers all static content with all the problems of > mime-types, character encoding and so on which I would have > to handle myself. > > 3.) Storing the content in a database on a separate server. > The advantage would be that webservers only need to know > their database server and updating the webapps would be easy > (just uploading new war-files). The downside here is that I > need a servlet too and I think it's maybe not the fastest > solution as all requests of all servers to each single chuck > of static content would require a connection to the database server. > > 4.) As 3.) but storing data on a single separate server in > the filesystem. The advantages/disadvantages should be > similar to 3.) whereby I do not know which solution might be faster. > > 5.) As 3.)/4.) but additionally implementing a > caching-mechanism on the webservers. This means if a > webserver gets a request for a specific page for the first > time he connects the database server to retrieve that page, > then stores it in its webapp directory and then let tomcat > deliver that page. On the second request it is just checked > if that page is already there and if so it is delivered > directly. Of course I must implement some mechanism such that > the webservers get to know if their cached data is outdated > but so far this seems to me the best solution. > > Anyone ever faced this kind of problem? Any kind of remark to > my possible solutions or any other possibilities you might > know of are appreciated. > > Thanks you in advance for your help. > > Bjoern > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where should I store my static content in a clustered environment
Bjoern Do you need some sort of fault tolerant system? Can you clarify the requierments you have, do you need load balancing, session sync replication, async replication? Traffic, SLA, concurrent connections, ... All these will have an impact on the choice and design of your infrastructure. Cheers Bruno Georges Glencore International AG Tel. +41 41 709 3204 Fax +41 41 709 3000 - Original Message - From: "Duan, Nick" [EMAIL PROTECTED] Sent: 23.11.2005 21:21 To: "Tomcat Users List" Subject: RE: Where should I store my static content in a clustered environment A simple solution would be to have all static pages hosted on an Apache httpd server in front of tomcat clusters. If you need more performance, just cluster the httpds. Tomcat is not really designed to server static pages. Apache httpd can also serve as a LB. In this case, certainly you have to treat static pages separately from dynamic webapps. In other words, you can't bundle static pages with your war files. ND -Original Message- From: Eickvonder Bjoern [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 4:23 AM To: users@tomcat.apache.org Subject: Where should I store my static content in a clustered environment Hi, lets start with describing my current task where I would appreciate any advice from you. I have to construct a clustered system (with lots of webservers) that has few dynamic pages but a lot of static ones, whereby all resources have to be protected by security-constraints of a webapp (so letting Apache deliver this content won't work). Moreover there should be the possibility to upload/delete static components via a web form. My main problem is now where should I store the static data (mainly html pages, images, ...; but over 4 GB(!) large in total)? As far as now I'm considering the following solutions: 1.) Storing the content within the webapp of each webserver. This would include that the servers know each other as the upload/delete operations must be propagated from one server to all the others. Moreover the update of the dynamic parts would not be as easy any more as just uploading a new war-file as this requires deleting the old webapp directory (that contains the content is this case as well). 2.) Storing the content in a separate directory but still on each webserver. This would still include that servers must know each other, but updating the dynamic part would be easier. The downside is that I would have to write a servlet that delivers all static content with all the problems of mime-types, character encoding and so on which I would have to handle myself. 3.) Storing the content in a database on a separate server. The advantage would be that webservers only need to know their database server and updating the webapps would be easy (just uploading new war-files). The downside here is that I need a servlet too and I think it's maybe not the fastest solution as all requests of all servers to each single chuck of static content would require a connection to the database server. 4.) As 3.) but storing data on a single separate server in the filesystem. The advantages/disadvantages should be similar to 3.) whereby I do not know which solution might be faster. 5.) As 3.)/4.) but additionally implementing a caching-mechanism on the webservers. This means if a webserver gets a request for a specific page for the first time he connects the database server to retrieve that page, then stores it in its webapp directory and then let tomcat deliver that page. On the second request it is just checked if that page is already there and if so it is delivered directly. Of course I must implement some mechanism such that the webservers get to know if their cached data is outdated but so far this seems to me the best solution. Anyone ever faced this kind of problem? Any kind of remark to my possible solutions or any other possibilities you might know of are appreciated. Thanks you in advance for your help. Bjoern - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly confidential and they may not be used or disclosed by someone who is not a named recipient. If you have received this email in error please notify the sender by replying to this email inserting the word "misdirected" as the message and delete this e-mail from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Where should I store my static content in a clustered environment
A simple solution would be to have all static pages hosted on an Apache httpd server in front of tomcat clusters. If you need more performance, just cluster the httpds. Tomcat is not really designed to server static pages. Apache httpd can also serve as a LB. In this case, certainly you have to treat static pages separately from dynamic webapps. In other words, you can't bundle static pages with your war files. ND -Original Message- From: Eickvonder Bjoern [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 4:23 AM To: users@tomcat.apache.org Subject: Where should I store my static content in a clustered environment Hi, lets start with describing my current task where I would appreciate any advice from you. I have to construct a clustered system (with lots of webservers) that has few dynamic pages but a lot of static ones, whereby all resources have to be protected by security-constraints of a webapp (so letting Apache deliver this content won't work). Moreover there should be the possibility to upload/delete static components via a web form. My main problem is now where should I store the static data (mainly html pages, images, ...; but over 4 GB(!) large in total)? As far as now I'm considering the following solutions: 1.) Storing the content within the webapp of each webserver. This would include that the servers know each other as the upload/delete operations must be propagated from one server to all the others. Moreover the update of the dynamic parts would not be as easy any more as just uploading a new war-file as this requires deleting the old webapp directory (that contains the content is this case as well). 2.) Storing the content in a separate directory but still on each webserver. This would still include that servers must know each other, but updating the dynamic part would be easier. The downside is that I would have to write a servlet that delivers all static content with all the problems of mime-types, character encoding and so on which I would have to handle myself. 3.) Storing the content in a database on a separate server. The advantage would be that webservers only need to know their database server and updating the webapps would be easy (just uploading new war-files). The downside here is that I need a servlet too and I think it's maybe not the fastest solution as all requests of all servers to each single chuck of static content would require a connection to the database server. 4.) As 3.) but storing data on a single separate server in the filesystem. The advantages/disadvantages should be similar to 3.) whereby I do not know which solution might be faster. 5.) As 3.)/4.) but additionally implementing a caching-mechanism on the webservers. This means if a webserver gets a request for a specific page for the first time he connects the database server to retrieve that page, then stores it in its webapp directory and then let tomcat deliver that page. On the second request it is just checked if that page is already there and if so it is delivered directly. Of course I must implement some mechanism such that the webservers get to know if their cached data is outdated but so far this seems to me the best solution. Anyone ever faced this kind of problem? Any kind of remark to my possible solutions or any other possibilities you might know of are appreciated. Thanks you in advance for your help. Bjoern - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Vedr.: Where should I store my static content in a clustered environment
Hi Eickvonder, I would definitely go for solution 5, which resembles an assigment we were given in a course in Distributed Computing. If possible go for active replication to distribute the load on several database servers. To implement this you must implement a common frontend (FE) communicating with the replica managers (RM). A read operation simply connects to the FE which (using round-robin or similar) connects to a database server. If youre not worried about byzantine errors simply fetch the first file being returned. A write operation connects to the FE which updates all database servers. If you settle for this solution but something seems a bit unclear I recommend reading up upon distributed computing terms (e.g. "Distributed Systems: Concepts and Design", G. Coulouris, J. Dollimore, T. Kindberg, Addison-Wesley, 4rd edition, 2005, ISBN 0321263545) As far as invalidation goes you can basically choose timestamp cache invalidation or callback cache invalidation. Timestamp cache invalidation will upon each read request read the last time the file was updated and if e.g. 5 minutes has passed read a new file from the database. This is rather simple but does not ensure consistency. Further if the html files really are "static" and not changed very often you will probably choose long timeouts to minimize the number of irrelevant reads thus prolonging the time the webservers are out of sync after an update has been comitted. If possible memorywise save the state (fileId as int, time as long) in a hashmap or similar on the webservers to avoid having to read from disk before determining whether to fetch from the database. Callback cache invalidation is better at acheiving consistency and minimizes reads from the database. The FE/RM should know which webservers has requested which files and send an "invalidate" to the those webservers when a client commits an update (thus ensuring webservers which have read the file will read it again once it is requested from a client). Also if possible here memorywise save the state (webserverId as int, fileId as int, time as long) in a hashmap or similar on the webservers to avoid having to read from disk before determining which webservers to invalidate. Good luck, Thomas "Eickvonder Bjoern" <[EMAIL PROTECTED]> 23-11-2005 10:23 Besvar venligst til "Tomcat Users List" Til: cc: Vedr.: Where should I store my static content in a clustered environment Hi, lets start with describing my current task where I would appreciate any advice from you. I have to construct a clustered system (with lots of webservers) that has few dynamic pages but a lot of static ones, whereby all resources have to be protected by security-constraints of a webapp (so letting Apache deliver this content won't work). Moreover there should be the possibility to upload/delete static components via a web form. My main problem is now where should I store the static data (mainly html pages, images, ...; but over 4 GB(!) large in total)? As far as now I'm considering the following solutions: 1.) Storing the content within the webapp of each webserver. This would include that the servers know each other as the upload/delete operations must be propagated from one server to all the others. Moreover the update of the dynamic parts would not be as easy any more as just uploading a new war-file as this requires deleting the old webapp directory (that contains the content is this case as well). 2.) Storing the content in a separate directory but still on each webserver. This would still include that servers must know each other, but updating the dynamic part would be easier. The downside is that I would have to write a servlet that delivers all static content with all the problems of mime-types, character encoding and so on which I would have to handle myself. 3.) Storing the content in a database on a separate server. The advantage would be that webservers only need to know their database server and updating the webapps would be easy (just uploading new war-files). The downside here is that I need a servlet too and I think it's maybe not the fastest solution as all requests of all servers to each single chuck of static content would require a connection to the database server. 4.) As 3.) but storing data on a single separate server in the filesystem. The advantages/disadvantages should be similar to 3.) whereby I do not know which solution might be faster. 5.) As 3.)/4.) but additionally implementing a caching-mechanism on the webservers. This means if a webserver gets a request for a specific page for the first time he connects the database server to retrieve that page, then stores it in its webapp directory and then let tomcat deliver that page. On the second request it is just checked if that page is already there and if so it is delivered directly. Of course
Where should I store my static content in a clustered environment
Hi, lets start with describing my current task where I would appreciate any advice from you. I have to construct a clustered system (with lots of webservers) that has few dynamic pages but a lot of static ones, whereby all resources have to be protected by security-constraints of a webapp (so letting Apache deliver this content won't work). Moreover there should be the possibility to upload/delete static components via a web form. My main problem is now where should I store the static data (mainly html pages, images, ...; but over 4 GB(!) large in total)? As far as now I'm considering the following solutions: 1.) Storing the content within the webapp of each webserver. This would include that the servers know each other as the upload/delete operations must be propagated from one server to all the others. Moreover the update of the dynamic parts would not be as easy any more as just uploading a new war-file as this requires deleting the old webapp directory (that contains the content is this case as well). 2.) Storing the content in a separate directory but still on each webserver. This would still include that servers must know each other, but updating the dynamic part would be easier. The downside is that I would have to write a servlet that delivers all static content with all the problems of mime-types, character encoding and so on which I would have to handle myself. 3.) Storing the content in a database on a separate server. The advantage would be that webservers only need to know their database server and updating the webapps would be easy (just uploading new war-files). The downside here is that I need a servlet too and I think it's maybe not the fastest solution as all requests of all servers to each single chuck of static content would require a connection to the database server. 4.) As 3.) but storing data on a single separate server in the filesystem. The advantages/disadvantages should be similar to 3.) whereby I do not know which solution might be faster. 5.) As 3.)/4.) but additionally implementing a caching-mechanism on the webservers. This means if a webserver gets a request for a specific page for the first time he connects the database server to retrieve that page, then stores it in its webapp directory and then let tomcat deliver that page. On the second request it is just checked if that page is already there and if so it is delivered directly. Of course I must implement some mechanism such that the webservers get to know if their cached data is outdated but so far this seems to me the best solution. Anyone ever faced this kind of problem? Any kind of remark to my possible solutions or any other possibilities you might know of are appreciated. Thanks you in advance for your help. Bjoern - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]