简体   繁体   中英

J2EE web application Performance Tuning

i am trying to improve the performance of my web application. It is a java based web application & deployed on an amazon cloud server with Jboss & apache.

There is one page in the application that is taking 13-14 seconds to open. The functionality is so much that there are about 100+ http requests that get executed on page loading time. The Js & css files are taking too much time to load.

So i moved all of the Javascript code from my JSP page to new JS files. Minified the JS & css files. Still there is not much difference in the page load time.

There is dojo data on this page as well which takes time to load.

Is there any other appproach i should try to tune this page?

Can something be done at the Jboss or Apache level?

  1. Apply caching for images etc. More here
  2. Use CDN for any external libraries you use (like jquery). More here
  3. Use a library for your js scripts like RequireJS to optimize your css and js files. You can concatenate (merge multiple js files to one) your code. This will reduce the number of ajax calls (that's what the browser does when it sees a js or css dependency) (As @Ken Franqueiro mentions in the comment section, Dojo already has a mechanism for this). More here
  4. Optimize your images. Use appropriate dimensions. Do not use full blown dimensions if you just intend to use it for a 10x10 container. Use sprites if possible. More here
  5. Show a message/loader to show the user some progress. This will minimize the user restlessness More here
  6. If you load data that takes too long, then show the page and load the data afterwards. This will too give some sense of progress to the user.
  7. If the response is very big you can compress your response data. Be careful though that the browsers your application supports, can handle the compressed information by default, or add a custom mechanism to decompress the data. More here

Use some profiling tools like Chrome Development Tools or FireBug for Mozilla . Take a snapshot of your network traffic and check where the bottleneck is. In Chrome you press F12 and then select the Network tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM