Java Application Server Performance

I've got a somewhat dated Java EE application running on Sun Application Server 8.1 (aka SJSAS, precursor to Glassfish). With 500+ simultaneous users the application becomes unacceptably slow and I'm trying to assist in identifying where most of the execution time is spent and what can be done to speed it up. So far, we've been experimenting and measuring with LoadRunner, the app server logs, Oracle statpack, snoop, adjusting the app server acceptor and session (worker) threads, adjusting Hibernate batch size and join fetch use, etc but after some initial gains we're struggling to improve matters more.

Ok, with that introduction to the problem, here's the real question: If you had a slow Java EE application running on a box whose CPU and memory use never went above 20% and while running with 500+ users you showed two things: 1) that requesting even static files within the same app server JVM process was exceedingly slow, and 2) that requesting a static file outside of the app server JVM process but on the same box was fast, what would you investigate?

My thoughts initially jumped to the application server threads, both acceptor and session threads, thinking that even requests for static files were being queued, waiting for an available thread, and if the CPU/memory weren't really taxed then more threads were in order. But then we upped both the acceptor and session threads substantially and there was no improvement.

Clarification Edits:

1) Static files should be served by a web server rather than an app server. I am using the fact that in our case this (unfortunately) is not the configuration so that I can see the app server performance for files that it doesn't execute -- therefore excluding any database performance costs, etc.

2) I don't think there is a proxy between the requesters and the app server but even if there was it doesn't seem to be overloaded because static files requested from the same application server machine but outside of the application's JVM instance return immediately.

3) The JVM heap size (Xmx) is set to 1GB.

Thanks for any help!


Asked by: Alissa573 | Posted: 23-01-2022






Answer 1

SunONE itself is a pain in the ass. I have a very same problem, and you know what? A simple redeploy of the same application to Weblogic reduced the memory consumption and CPU consumption by about 30%.

SunONE is a reference implementation server, and shouldn't be used for production (don't know about Glassfish).

I know, this answer doesn't really helps, but I've noticed considerable pauses even in a very simple operations, such as getting a bean instance from a pool.

May be, trying to deploy JBoss or Weblogic on the same machine would give you a hint?

P.S. You shouldn't serve static content from under application server (though I do it too sometimes, when CPU is abundant).

P.P.S. 500 concurrent users is quite high a load, I'd definetely put SunONE behind a caching proxy or Apache which serves static content.

Answered by: Thomas489 | Posted: 24-02-2022



Answer 2

After using a Sun performance monitoring tool we found that the garbage collector was running every couple seconds and that only about 100MB out of the 1GB heap was being used. So we tried adding the following JVM options and, so far, this new configuration as greatly improved performance.

-XX:+DisableExplicitGC -XX:+AggressiveHeap

See http://java.sun.com/docs/performance/appserver/AppServerPerfFaq.html

Our lesson: don't leave JVM option tuning and garbage collection adjustments to the end. If you're having performance trouble, look at these settings early in your troubleshooting process.

Answered by: Brooke654 | Posted: 24-02-2022



Similar questions

java - Spring and Hibernate application - performance issue on server

I'm getting the following error on the server: Nov 25, 2013 2:01:59 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet dispatcherServlet threw exception java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2245) at java.util.Arrays.copyOf(Arrays.java:2219) at java.util.ArrayList.grow(ArrayList.java:242) at java.util...


java - What tools for server side application performance testing you suggest?

Closed. This question does not meet Stack Overflow guid...


java - Response Time is different for mulitiple execution of the application with the same request Performance problem

My java application functionality is to provide reference data (basically loads lots of data from xml files into hashmap) and hence we request for one such data from the hashmap based on a id and we have such multiple has map for different set of business data. The problem is that when i tried executing the java application for the same request multiple times, the response times are different like 31ms, 48ms, 72ms, 120ms, ...


jakarta ee - Which FOSS Java application should be used in a performance test?

I would like to write an online book that shows people how to tune a Java web application by example. Using free tools, it will show people how to load test and monitor their apps so that they can make incremental performance improvements. I already know that I want to use Jboss + Apache + Ubuntu. I don't really care whether I use MySQL or Postgresql. I also plan on using The Grinder to run my perf tests. N...


Java web application performance


java - Do compiler warnings has any impact on Web Application performance

Being a lazy programmer i usually overlooks compiler warnings both in Jsp and Java code. I can justify JSP warning by thinking that missing JavaScript, validations and other stuff could be resolved at run-time. but needs to be sure. but i am always teased by Java warnings like [GENERIC Type] is a raw type. References to gen...


java - Log4j logs decreases application performance?

Does logging decreases application performance? and how to restrict display-tags logs to be printed in log files? eg. my log file has below logs [2012-06-20 15:52:06,290] org.displaytag.tags.TableTag isFirstIteration 684 - [data] first iteration=true (row number=1) [2012-06-20 15:52:06,290] org.displaytag.tags.TableTag isFirstIteration 684 - [data] first iteration=true (row number=1) [2012-06-20 15:...


Java application performance changing based on how it is executed

hopefully this is an easy and quick question. I recently developed a CPU intensive java application in Netbeans. It uses A* pathfinding tens of thousands of times per second to solve a tiles matching game. The application is finished, and it runs pretty fast (I've been testing in netbeans the whole time). I've clocked it at 700 attempts per second (each attempt is probably 20 or so pathfinds). When I build the project it c...


Java EE web application performance tuning

I need to do a performance analysis of Java EE web application and optimize the code. Please suggest ways of doing it? To start with, I am checking the server logs.


Does "dead" code hinder Java application performance?

I just installed the Unnecessary Code Detector for Eclipse and ran it on my project. I see a lot of so-called "dead code". Although, from an organizational standpoint, it makes sense to remove dead/unnecessary code, it got me thinking: Does dead code actually hinder a Java app's performance?!?! To me, if code is tr...


Is Java application performance dependent on passing of variables to method?

Maybe this is trivial question for experienced programmers but i wonder if there is any significant performance difference (with big or very big amount of data in collection) between two difference approaches of passing variables? I've made a tests but with rather small data structures and i don't see any significant differences. Additionally i am not sure if these differences aren't caused by interferences from o...


windows - IE6 generated strange worksheet name when doing export from java application

I am encountering error like test(10)[1].csv file cannot be found at C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW When trying to do export of CSV file using the following codes. Anyone have any idea what could be wrong? This issue does not occur in IE7 / Firefox and is only specific to IE6. response.setContentType("applicati...


c# - Embedding Flash Player in a C++ or Java application?

I would like to embed Flash Player directly inside a C++ or Java application. I found an article that describes how to do this for C#: http://www.adobe.com/devnet/flash/articles/stock_history03.html Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing ...


java - How best to implement user selectable variables in web application

I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this? I was thinking of having a pre-defined set of variables such as : @BOOKING_NUMBER@ @INVOICE_NUMBER@ Then when a user enters some text they can specify a variable inline ...


java - BIRT in a desktop application

Did someone ever used a BIRT report in a desktop application. I'm comming from the .NET environment and there you can use Crystal Reports to show reports in desktop apps. Is this possible with BIRT too, without having to set up a server environment? Can you give me some advice how to reach this goal? Thanks in advance.


which library better for faster java application swt or swing?

which library better for faster java application swt or swing?


java - Which is the best Open source application server?


java - Access spring bean that is exposed using http invoker from GWT application

Can I access spring bean that exposed using http invoker (server) from GWT application (client)? If so is there any example / tutorial for that?


How to close a Java Swing application from the code

What is the proper way to terminate a Swing application from the code, and what are the pitfalls? I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do...


java - How best can I isolate my application from an unreliable database?

I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day. The SOAP service provides data to a calculation grid and when I request data, I need the response time to be ...


java - Netbeans GUI Designer & Fixed-Size Application Panels

I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size. When I start a new GUI project in NetBeans, I set the properties of the main panel for min/max/preferred size to 800 x 600, and the panel within the 'Design' view changes size. ...






Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top