I am having horrible nightmares, night after night, that the application I am designing using POJOs and SLSB based session facade has performance / scalability issues...
How do you measure performance? What is "optimal" and "acceptable" performance for you? What "scalability" are you after? How do you intend to track and project the need to scale up and down? What parameters do you intend to use as decisive factors to conclude "scalability" is a problem, and that you need to add more beef to the server (or add more servers)?
...because there are too many objects that get created per request namely DTO, BizO, VO, DAO.
How is object creation a problem, if they are created in different VMs (or by different Classloaders within the same VM)? Have you tracked the object creation times to pinpoint it is the object creation that is indeed a problem?
...Garbage Collection is the monster that haunts me.Any experts in dream interpretation who can allay my fears.On a reasonable-spec host, install Tomcat and a ejb container of your choice. Write a simple application that has a JSP posted to a Servlet which then calls an EJB. The EJB should fetch a row from the database (using your DTO) and returns a DAO to your resultant JSP, which then displays the values.
Now simulate several clients, using Apache HttpMeter, or using Cactus/JUnit test cases.
Plot response times with:
1. Database Size: Try with less than 100,000 records, less than 500,000, less than 1 million, and less than 5 million
2. Number of users: Again, try with 1 user, 5 users, 10, 15 and 25.
Plot the response times for number of users against response time, along with resource usage (CPU, RAM), and find the critical point where the performance becomes unacceptable (both for data volume and number of users).