6 Replies Latest reply on Jul 1, 2009 10:39 PM by Dave Everson

    Seam in production: VPS Cluster?

    Mark Varley Newbie

      Hi all - I am moving my Seam app into production and would be very grateful for any help or advice from others who have been through this.


      I am in the process of choosing hardware and want to get the best performance for my money and also future-proof this so can scale up as my needs and budget increase.  My initial budget of 300 USD a month buys me a dedicated server (Intel Core 2 Quad Core Q6600 Kentsfield 2.4GHz 2 x 4MB L2 Cache with 8gb memory running 2 x 400GB SATA Disks (with RAID)) running CentOS.


      My host tells me: Ideally, you should split all the services on a separate VPS. This will allow you anytime moving the most demanding service to a new server for better performance. Depending on the service, multiple servers could be used to provide load sharing. But if the application is developed to work as a whole (ie. all services on the same server), splitting them will only give you headaches.


      So, I have 2 questions:


      1) Does anyone have experience of running Seam in this environment i.e. dedicated server running multiple VPSs?  If so how many VPS would you recommend?  I was thinking:



      • 1 VPS for Apache (which would load balance and route requests to the JBoss servers) and other stuff such as Postfix for email etc. 

      • 1 VPS running the 2 instances of JBoss AS 5

      • a third VPS running MySQL

      • possibly a fourth to act as a staging server running a slimmed down version of the architecture for testing app changes prior to moving them into production.



      Any thoughts/recommendations would be much appreciated.


      2) Are there any specific things I need to think of to run my Seam app in a clustered environment?  I am going to follow through the advice on http://www.mastertheboss.com/en/jboss-server/48-jboss-clustering-web.html for the clustering, any other links or tips would be much appreciated



      If there is anything else that I haven't thought of I would be very grateful for any advice at all.


      Thanks,


      Mark



      P.S. I haven't found an area on the Seam website for people to share their thoughts and recommendations on taking a Seam app live, am sure this is something of interest to most developers as it's quite a daunting experience if you haven't done it before, perhaps this could be a good idea?




        • 1. Re: Seam in production: VPS Cluster?
          Duncan Stockdill Newbie

          Hi Mark,


          We run a similar set up as you have proposed for javelincrm.com. Works well. We don't cluster the app servers because there is potential to introduce more problems than it solves.  in our case if an app server goes down the user just gets redirected to the login page and logs back in on a new app server.  In 6 months of live running we've only had an app server go down once.


          I'd suggest looking at Amazon EC2 which is what we use.  Your budget of $300 USD/month gets 4 small instances plus an ESB device for the database.  Being able to bring new servers online and just pay by the hour gives some neat benefits:



          • when deploying a new build you can power up the new build on new servers before bring the old ones down (so zero/little downtime)




          • it's relatively easy to scale up as load dictates e.g you get a busy month




          • bring up a new server/environment for testing, and drop when done


          • 2. Re: Seam in production: VPS Cluster?
            Mark Varley Newbie

            Hi Duncan - I've had a look at EC2 as suggested and am really interested, sounds like a good fit for my requirements.  I don't envisage needing to scale down as my demand should grow and is not really subject to seasonal fluctuations but I like the idea of minimal sysadmin and the ability to scale up easily and the temporary staging option.  I've signed up for an EC2 account and am planning on trialling this over the weekend.  I have a few questions and would be really grateful for any help:



            • Can you suggest any good tutorials specific to JBoss / MySQL as I find the Amazon docs a little difficult to get started with.

            • What AMI(s) did you use?

            • Do I need a separate instance for the load balancing?

            • Do you host your email on EC2 as well?  If so is this running on a separate instance or do you just use one of the AMIs with Jboss running?

            • I don't want to pay licences for JBoss and MySQL - am happy with the community editions, however the instances I've found so far (from Redhat site) seem to come bundled with enterprise.



            Any other hints and tips would be great!


            Thanks,


            mark




            • 3. Re: Seam in production: VPS Cluster?
              Mark Varley Newbie

              Another couple of thoughts/questions:



              • What is the support like from Amazon if things go wrong?

              • My customer base is global, is it possible to have 2 instances in US and 2 in Europe with requests routed to the closest server (if resource is available) - do you have any experience with this?



              Thanks again,


              mark




              • 4. Re: Seam in production: VPS Cluster?
                Duncan Stockdill Newbie

                Hi Mark,



                Can you suggest any good tutorials specific to JBoss / MySQL as I find the Amazon docs a little difficult to get started with.

                We use RightScale to manage the deployment.  They have a free developer account which is actually fine for production.  They also have standard templates for MySql instances.  You'll need to create scripts and templates for installing a JBoss app server.



                What AMI(s) did you use?

                Rightscale CentOS AMI



                Do I need a separate instance for the load balancing?

                Yes, that's the easiest option. we use apache for load balancing over the app servers and for serving static content.



                Do you host your email on EC2 as well? If so is this running on a separate instance or do you just use one of the AMIs with Jboss running?

                yep, we host. you could install on a separate instance or on an apache instance. depends a little on how you manage the environment.  e.g. if you create a new apache server when deploying a new release then email on the same box makes the switch over harder



                I don't want to pay licences for JBoss and MySQL - am happy with the community editions, however the instances I've found so far (from Redhat site) seem to come bundled with enterprise.

                Yep, you can run your own instances on the community edition.  Just a matter of installing JBoss on the instance.



                What is the support like from Amazon if things go wrong?

                EC2 is a utility computing service with a very focused set of services and tools.  It's also been around a while.  The result is reduced scope for things to go wrong compared with a more bespoke hosting solution.  Servers can go down (we've had it happen once), but in this scenario we don't involve Amazon (no need) - we just bring up a replacement.  They have active support forums that have been very helpful.



                My customer base is global, is it possible to have 2 instances in US and 2 in Europe with requests routed to the closest server (if resource is available) - do you have any experience with this?

                It is possible to have instances in both regions.  Choosing which instances to send a user to would need to be done at a DNS level, or by redirecting the user (based on a geoip solution) to an address for each region.  Not easy, but certainly possible.  Amazon CloudFront enables this for serving static content such as your sites images, css and javascript etc. Doesn't help for instance hosting though.


                Good luck!


                Duncan

                • 5. Re: Seam in production: VPS Cluster?
                  Mark Varley Newbie

                  Thanks again for the great advice Duncan, very much appreciated.


                  mark



                  • 6. Re: Seam in production: VPS Cluster?
                    Dave Everson Newbie

                    Duncan - as our application is growing we want to move to the cloud.  we are looking at RightScale - do you have any references or suggestions on how to update the RightScripts for JBoss?  We are looking at starting with the Tomcat image and modifying this for our Seam/JBoss environment.  Any suggestions would be greatly appreciated.  Thanks!