Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance of Struts2 based application  RSS feed

 
Karan Saxena
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way by which I can increase Struts2 based web application performance if my network is slow ???

Maximun I can think of is ,Keeping size of WAR small .

Removing unwanted comments and white space to increase performance .

Please let me know is there any other way ,by which I can achieve better performance when network is slow .

 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use compression on the fly (gz compression). Our apache reverse-proxy takes care of compressing the data when the browser supports it, most browsers do.

Our network is 100mbps, relatively fast, but it saves bandwidth and makes things faster for clients on slow networks.

I don't see how the size of your war file would be relevant to solve slow network problems. Removing html style comments might help although they compress really well. Just use java style comments, those are not sent to the client and are generally safer to use from a security perspective.

Inefficient:
<!-- comment -->

Efficient network wise:
<% // comment %>
 
Karan Saxena
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read the web ,, and came to know that apache reverse proxy increase web performance by caching ,so that popular web pages don't have to refetched .

You have mentioned that gz compression can be used to compress data on the fly .Please elaborate what data are you talking about ,is it the data we fetch from database ,or you are talking about something else .


Please elaborate gz compression ,I am new to this
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karan Saxena wrote:I read the web ,, and came to know that apache reverse proxy increase web performance by caching ,so that popular web pages don't have to refetched .



This is true, But slow down. There is no need to use a reverse-proxy yet. On a slow network, enabling compression is the priority. Enabling caching at the server level will only save resources on the server hardware without any relevancy on the network load.

I have the following questions:

1) What is the speed of your network?
2) What server are you using?
3) what is your payload? (e.g. what do you transfer over the network? mostly text, mostly images, mostly audio, mostly video, etc.)



You have mentioned that gz compression can be used to compress data on the fly .Please elaborate what data are you talking about ,is it the data we fetch from database ,or you are talking about something else .


Please elaborate gz compression ,I am new to this


I am am pretty sure I can help you in enabling compression on your server without the need to install complex hardawre/software if you tell me which server you are using. Just answer questions above please.

Cheers,
 
Karan Saxena
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for the prompt reply :-

Here are the answers to your question :-

1. The speed of my network is around 2 mbps

2. I am using Jboss as 7.1

3.My payload include JSON DATA ,images ,text ,no videos ,,nested jsp

Hope to get an answer soon
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karan Saxena wrote:Hi thanks for the prompt reply :-

Here are the answers to your question :-

1. The speed of my network is around 2 mbps

2. I am using Jboss as 7.1

3.My payload include JSON DATA ,images ,text ,no videos ,,nested jsp

Hope to get an answer soon


2mbps isn't that slow. Are you already experiencing network bottlenecks? If yes, how many concurrent users are using you system? I just want to make sure the problem isn't somewhere else. I thought you were on 56kbps or something.

Anyway, just search Google for "enabling gz compression in jboss 7" to find plenty of answers.

When you configure compression, just remember not to compress already compressed documents, namely; .pdf, .jpg, etc.

Basically, just compress text/html (or jsp output), bmp, wav or anything that is not already compressed by nature.

If you serve high resolution images, video, audio, just downscale the resolution. This might solve your problem if you do not have a high html payload that would be subject to compression for better performances.



 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A.J. Côté wrote:
Karan Saxena wrote:Hi thanks for the prompt reply :-

Here are the answers to your question :-

1. The speed of my network is around 2 mbps

2. I am using Jboss as 7.1

3.My payload include JSON DATA ,images ,text ,no videos ,,nested jsp

Hope to get an answer soon


2mbps isn't that slow. Are you already experiencing network bottlenecks? If yes, how many concurrent users are using you system? I just want to make sure the problem isn't somewhere else. I thought you were on 56kbps or something.

Anyway, just search Google for "enabling gz compression in jboss 7" to find plenty of answers.

When you configure compression, just remember not to compress already compressed documents, namely; .pdf, .jpg, etc.

Basically, just compress text/html (or jsp output), bmp, wav or anything that is not already compressed by nature.

If you serve high resolution images, video, audio, just downscale the resolution. This might solve your problem if you do not have a high html payload that would be subject to compression for better performances.






I should have asked:

1) What is the average connection speed your users have?
2) What is the slowest connection speed your users have?

Sorry about that,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!