Thursday, December 31, 2009

Some Ways To JBoss Performance Tuning

I found this great article written by F.Marchioni at his website. You can read detailed article at his website by clicking here. This is my all time favorite reference for tuning up my JBoss.
I am just providing just a gist of what he is saying regarding the JBoss Performance Tuning.
1. Tune the garbage collector
2. Set -xms and -xmx to the same value
3. Use server vm
4. Turn off distributed garbage collection
5. Turn on parallel garbage collection
6. Don’t use huge heaps, use a cluster
7. Don’t choose an heap larger then 70% of your os memory
8. Tune the heap ratio
9. Monitor the free memory with monitors and snapshots
10. Tune the operating system
11. Lots of requests ? Check jboss thread pool
12. Check the embedded web container
13.  Turn off jsp compilation in production
14. lots of ejb requests ? Switch to the poolinvoker
15. Have you got readonly entity beans ? Tell it to jboss
16. Disable the hot deployer in production
17.  Configure the ejb container to use cache, when possible.
18. Use cache invalidation in a cluster for commit option a
19. Synchronize at commit time when possible.
20. Use prepared statement cache
21. Remove services you don’t need
22. Tell log4j to shut up !

“Internet Explorer Cannot Download” Error Message When You Use HTTPS URL

Internet Explorer will not display attachments when HTTPS is used. This bug has been documented in the link below.
If  the development environment is not using HTTPS this issue will be
identified only at a later stage when we move on to integration testing
environment where we normally use HTTPS.
The following are the steps to be followed for the workaround.
1. In the Servlet code please use the below snippet.
2//If the report type is other than PDF handle accordingly]
4response.setHeader("Content-Disposition","attachment; filename=Report.pdf");
6//pragma can be set to other available options also.
9//The logic to write into the OutputStream goes here.
Note: The reset of HttpServletResponse is very important.
Following are to be ensured on the browser (client).

1. Ensure Do not save encrypted pages to disk check box is not selected in Internet Explorer.
2.  Incase of IE 7, ensure the automatic prompting for downloads is enabled
under Tools–>Internet Options–>Custom Level –> Downloads.