Want to tune Liferay for better performance? There are several things that you can do. There is no magic wand that turbo charges your web app. There is this wiki article which has some properties you can set:
But in the end, Liferay is a Java web application that runs in the JVM. Hence, you have to do some JVM tuning. Java profiling can be very useful in pinpointing potential problem areas and bottlenecks. We don't necessarily endorse a particular Java profiler, but I'll just give an example using YourKit. Java profiling and tuning is largely an iterative process. You profile, analyze, tune... rinse, repeat. Everyone's app is different. But in the end you want to make CPU and memory usage more efficient, resulting in faster response and performance.
1) A working Liferay installation on Tomcat
2) YourKit for the platform your app is running, on as well as the platform you want to run the profiler from.
1) You have to run Tomcat with profiling enabled.
2) You then run the profiler client and attach it to that web app. It will find it because it was started with profiling enabled.
1) Set up Tomcat to be profiled
There are excellent steps here, but here it is for your benefit:
Run the wizard:
java -jar lib/yjp.jar -integrate
That should create a script: tomcat/bin/startup_with_yjp.sh
What is the difference you ask? Well, it is simply the startup.sh file with some extra libraries, enabling it to be profiled. You run this script when you profile, not in production. Here's a diff:
It basically added:
# Generated with YourKit Java Profiler 7.5.0
# Path to proper version of profiler agent library (Linux, 32-bit JVM)
2) Let's start Tomcat with the new script.
It should output something like this in the log:
Picked up JAVA_TOOL_OPTIONS: -agentlib:yjpagent=sessionname=Tomcat
[YourKit Java Profiler 7.5.0] Using JVMTI (10.0-b22;Sun Microsystems Inc.; mixed mode, sharing;
Linux;32 bit JVM)
[YourKit Java Profiler 7.5.0] Profiler agent is listening on port 10001...
[YourKit Java Profiler 7.5.0] *** HINT ***: To get profiling results, connect to the application
from the profiler UI
Jun 5, 2008 7:17:30 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
3) Start up the YourKit profiler.
Click "Connect to locally running profiled application..." and it will find the Tomcat you just started! From there, it will create new tab with a profile of your app.
You can see what your web app is doing live. Click "Start CPU Profiling" but uncheck "Profile J2EE" so you can focus on just Liferay.
To analyze deeper, you need to take a performance snapshot and memory snapshot.
To get a really useful snapshot, you will need to run some sort of load generator, such as JMeter. Then take the snapshots. From there you can identify "hot spots" and make tweaks from there. Again, this is an iterative process, until you get what you want.
I can't really recommend specific JVM tuning settings, because, as I stated before, every app is different. You need to identify problem areas and address those as they come along. Needless to say, there is some JVM expertise required here. You can also hire Liferay's consulting services for a custom solution that fits your system's performance requirements.
Anyhow, that should get you started. There is a lot of helpful info here on diagnosis: http://yourkit.com/docs/75/help/
Read up on how to troubleshoot performance problems and how to use and interpet the data in YourKit.