4 Replies Latest reply on Jun 4, 2009 10:04 AM by Nikolay Elenkov

    Estimation: Hardware requirements for Seam project

    peter irmstadt Newbie

      Hi!


      I developed a specialized web shop using Seam. While all first test were successfull I don't have any idea how much RAM the JBoss AS will need when the Seam application is used by several users      simultaneously.


      The project consists of 21 Entity Beans and about 12 SFSB. At the first phase there won't be more than 20 users at the same time.


      What do you think - how much memory will the JBoss AS (I am using version 4.2.1.GA) need? Do you have a recommendation for special VM parameters?


      Regarding performance in productivity - what would you prefer, MySQL or HSQLDB?


      Thank you in advance!

        • 1. Re: Estimation: Hardware requirements for Seam project
          Nikolay Elenkov Master

          peter irmstadt wrote on Jun 03, 2009 21:22:


          I developed a specialized web shop using Seam. While all first test were successfull I don't have any idea how much RAM the JBoss AS will need when the Seam application is used by several users      simultaneously.


          Profile it to find out how much memory it actually uses.



          The project consists of 21 Entity Beans and about 12 SFSB. At the first phase there won't be more than 20 users at the same time.

          What do you think - how much memory will the JBoss AS (I am using version 4.2.1.GA) need? Do you have a recommendation for special VM parameters?



          The number of concurrent users is probably the most important. If it is really only 20, you might be OK with 2 gigs, but all depends on
          your app. So again, profile to be sure. On the other hand, RAM is cheap, so:



          • use a 64-bit OS

          • stick as much RAM as you can afford

          • increase as needed :)



          And you should probably upgrade your JBoss.



          Regarding performance in productivity - what would you prefer, MySQL or HSQLDB?


          Oracle :) For a production app, HSQLDB is probably not an option, so that leaves MySQL, I guess.




          • 2. Re: Estimation: Hardware requirements for Seam project
            Jean Luc Apprentice

            What do you think - how much memory will the JBoss AS (I am using version 4.2.1.GA) need? Do you have a recommendation for special VM parameters?


            You are asking very general questions - the answer depends immensely on your application so the only person who can actually answer is yourself (or anyone from your team). How much memory JBoss uses is trivial to find out: just measure it. How much memory your application uses on top, that's what you need to find out, no one on this forum can answer that.


            Regarding VM parameters, there are many knobs to tune, but only a fraction of people changing them usually understand what they do. And from those, only a fraction actually need to change them. From what you said, your application has low performance requirements (several users) so how the application is written is many times more important than the VM parameters. I'd suggest to leave those settings alone (apart from -Xmx which you may need to increase) and for everything else, measure. If you want to change a parameter, first develop a good way to measure the performance, then measure before, make a change, measure afterwards, then compare.

            • 3. Re: Estimation: Hardware requirements for Seam project
              peter irmstadt Newbie

              thank you for your answers!


              I know that my question is too general to be answered excactly as you don't know my application. My problem is, that I don't know how to simulate 20 concurrent users on my application - what would you propose how to do that?


              I am quite new to Seam, JBoss and JEE even though I've used Java SE for years. My company switched from  ASP.Net to JEE quite quickly and I am the 'lucky one' who has to do all the work atm. I know profiling from ASP.Net and general stand alone application. But how can profiling assist me in calculating memory consumption? By the way - is there a (free or lowcost) way to do profiling with Eclipse and JBoss AS?


              Nikolay, you told me to upgrade my AS. What version would you propose? Is there a performance gain related with upgrading?


              I bought the two books 'Seam Framework' (Yuan) and 'Seam in Action'. Are there any other books or internet sources about performance tuning Seam applications available?

              • 4. Re: Estimation: Hardware requirements for Seam project
                Nikolay Elenkov Master

                peter irmstadt wrote on Jun 04, 2009 09:36:


                I know that my question is too general to be answered excactly as you don't know my application. My problem is, that I don't know how to simulate 20 concurrent users on my application - what would you propose how to do that?



                You can use JMeter for that.



                But how can profiling assist me in calculating memory consumption? By the way - is there a (free or lowcost) way to do profiling with Eclipse and JBoss AS?


                Even JDK 6 has a profiler (jmap/jhat). IMHO, Eclipse Memory Analyzer is easier to use and less resource hungry. Those work on
                heap dumps, but there are tools you can use on a 'live' JVM. Haven't used any of those, so can't really recommend anything.


                How profiling helps: if you dump the heap of a live JBoss, you can see how much memory it uses (with 10, 20, 100 users).
                If you see you have 2000 User objects with 20 live users, that would hint that you are not releasing stuff properly, etc.



                Nikolay, you told me to upgrade my AS. What version would you propose? Is there a performance gain related with upgrading?


                Well newewst is usually best, so 4.2.3 if you decide to go with 4.2.x. There are quite a few bugfixes, including memory leaks.



                I bought the two books 'Seam Framework' (Yuan) and 'Seam in Action'. Are there any other books or internet sources about performance tuning Seam applications available?


                You should be set as far as Seam is concerned. You will also need a good (and recent) J2EE book ('Enterprise JavaBeans 3.0' from O'Reilly is good) and something on JSF ('JSF in Action'). Thoroughly understanding JSF will help you avoid performance-killing code.


                Tuning Seam

                Part 1
                Part 2
                Knowledge Base


                HTH