views:

62

answers:

4

I have two questions regarding Java web application deployment and its impact on performance. We have an application deployed on serverA, with JSPs exploded in to one content directory (that means JSPs are not part of the WAR) question 1: What I knew was this was an approach for development rather than any other environments. Does this exploded deployment slow down performance?

now, the content directory is cross mounted(NFS share) to another hardware, and there we run serverB, which also use the JSPs for its content. When both serverA and serverB are running and utilizing the same content, can it slow down the performance?

+1  A: 

The first time any jsp is needed, it would be compiled into a servlet and stored in the web container's cache(at-least tomcat does it). Since the cache folder is not over NFS, that shouldn't affect web sevrer performance. It might be a good idea to precompile your JSPs though.

letronje
A: 

If you application's JSPs are precompile and the compiliation feature is closed in Servlet container, it does not impacts your application's performance,because the JSPs were compiled to their .class file,and then they would be loaded by container.

Mercy
+1  A: 

Deploying JSPs in exploded form (rather than in a WAR file) won't make any difference from a performance perspective. When a WAR file is deployed, it is unpacked anyway.

Putting content (including JSPs) in an NFS mounted file system will make access to the files, and can lead to operational issues if your NFS mounts go stale at the wrong time. This will happen the first time a JSP is used, and can also happen at other times if your JSP engine is configured to periodically check for changed JSPs.

Stephen C
+1  A: 

Exploding the WAR should slightly improve deploy time, but the server is going to explode the WAR file anyways when it's deployed.

As other replies pointed out, JSPs are translated into servlets and then compiled into .class bytecodes. This happens the first time a user accesses that JSP, and this will produce lag-time for the users, especially if it's a complex page. The best way around this is to precompile the JSPs.

Dean J