How to reduce Liferay 6 startup time - liferay-6

Liferay 6.1 takes roughly 60-120 seconds to start on my developer machine. Unfortunately we have to start Liferay very often, so this delay hurts. Actually, most features of Liferay aren't needed by a developer (at least not for us). Is it possible to reduce the amount of time Liferay takes to start? Maybe by removing unused functionality, such as blog, chat and forum?
Please note that I'm not talking about deployment time, which can be reduced a little by following the hints in another StackOverflow thread.

removing unused functionality - that's a good idea, just it will be hard on Liferay 6.1. This is what modularity promises to make possible for Liferay 7, where you should be able to remove the unwanted OSGi bundles. Unfortunately Liferay 7 is not out yet (as of the time of writing this answer beta4 is out) and you're explicitly asking about 6.1.
You could try to deactivate several components - most likely by changing several of the spring configuration files in an ext plugin. However, this has rarely been done, so it might have consequences that nobody has ever seen. Also, it will probably be hard to maintain and upgrade this configuration.
Another way to solve this problem is to ask "Why do you have to restart so often?". In fact, utilizing JRebel for deployments - especially on a developer machine - has shown to be quite effective.
In the answer to Meera Prince's answer you're stating the "generous memory settings" of 1024G - while I agree that this shouldn't limit you in the upstart time, you might want to monitor it, so that you at least don't run into garbage collection during startup time. For a Java application the size of Liferay, 1G memory might be sufficient, but I'd not call it "generous".
Note that 8G RAM on a development machine might be your limitation: As soon as your machine hits virtual memory and starts paging to disk, all bets are off and you'll suffer. And I have no clue what else you're running: Browsers, IDE, Editors, Word Processor, Liferay, random other applications and services. You're hopefully on a 64bit OS.

If you have 8GB of RAM, then put more for Liferay e.g.
CATALINA_OPTS="-Xms4G -Xmx4G -XX:MaxPermSize=512m"
using of CATALINA_OPTS is better then JAVA_OPTS, because JAVA_OPTS will be allocated by shutdown of tomcat too, and CATALINA_OPTS only by startup.
And you can disable not necessary Filters in portal-ext.properties, e.g.
com.liferay.portal.servlet.filters.sso.cas.CASFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter = false
com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter= false
com.liferay.portal.sharepoint.SharepointFilter = false
com.liferay.portal.servlet.filters.gzip.GZipFilter = false
See Liferay: How to configure Liferay Portal

If you are using Tomcat to run Liferay, the following will greatly reduce the time it takes to startup. Modifying your catalina.properties file attributes shown below. The article goes into the details.
org.apache.catalina.startup.ContextConfig.jarsToSkip=*
org.apache.catalina.startup.TldConfig.jarsToSkip=*
tomcat.util.scan.DefaultJarScanner.jarsToSkip=*
http://www.gpickin.com/index.cfm/blog/how-to-get-your-tomcat-to-pounce-on-startup-not-crawl

You may buy an SSD HD
8G RAM must be enough for Liferay 6.1 + Browser + Eclipse, however I have 16G, but I very often have two Liferays running an 20+ open browser windows
A CPU with 4 core can be relevant
Undeploy deployed but not needed portlets

Its depends on resource allocation for liferay JVM means heap and permzen space.
and also depends on your system RAM size
find java script and css related proprieties in liferay portal.proeprties file.
Use Java_OPTS as follows
-Xms1024m -Xmx1024m -XX:MaxPermSize=512m
https://www.liferay.com/community/wiki/-/wiki/Main/Liferay+Developer+Modee
http://www.liferaysavvy.com/2013/12/liferay-environment-challenges-and.html
https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-theme-developer-mode

I think, using ramdisk may worth a try.
Windows 7:
http://www.laptopmag.com/articles/faster-than-an-ssd-how-to-turn-extra-memory-into-a-ram-disk
Linux:
http://www.jamescoyle.net/how-to/943-create-a-ram-disk-in-linux
If you have many deployed plugins, it can shorten the startup time.
Without deployed plugins (only with marketplace) I measured the same starttime than with my hdd.

Related

JBoss 7 troubleshooting slowness

We have an application on JBoss 7.1.0 istance, usually running ok but sometime the performance degrading, in this case a restart of JBoss is useful.
I have configured an access.log to record the timing of the pages and when the performance are degrading, we have an increase in recorded time on it for some pages.
How can I better identify and troubleshoot the problem? I think can be a problem related to objects in memory of JBoss server.
I exclude can be a memory issue on client because the access.log record the slow time, is it right or can I be misinterpreting the access.log and the problem can be also on client?
The ram / cpu on server are not under load when there are slowness and the xmx is oversized.
The JBoss is on Windows with JDK 1.7.0_80.
Thanks
UPDATE: Our degrading performance problem was related to an APM configured to record too much data and solved by removing it (are needed to be better configured).
I don't think JBOSS server has a problem. By reading your statement, I think the your code is leaking connections. Login into JBOSS Console and see the stats of your connection pools (you need to enable stats if not enabled already). If the connection count grows linearly and never comes down then you need to fix the leakage at code level. You can also use JConsole to monitor JVM memory and detect problems.

Why does NetBeans use Tomcat Manager (and Eclipse does not)?

As a long-time J2EE developer, I have always been curious as to why NetBeans uses(i.e. forces you to use) the Tomcat Manager app to deploy while Eclipse seems perfectly happy/able to deploy without the manager app? Though I have googled this exhaustively over the years, I have never found even the beginning to an answer. Perhaps this is nothing more than how each product started and has never changed.
Does anyone have any insight or educated theories they would be willing to share?
[Edit] Sigh... to address shekhar's comment, I see that it is not absolutely clear that I am referring ONLY to using Tomcat. I mistakenly assumed that the title and context of my question was sufficient, but again, I am specifically referring to using Tomcat as the Servlet Container with these IDEs. Thanks.
[Edit] I don't know who down-voted this but I have researched this for a long time and found zero reason for it. As for down-voting because it might not be useful, I think that is in the eye of the beholder; also, it usefulness can only be determined based on the answer which is why I am asking.
Sounds like a good topic for Quora but anyway...
I can only speak about NetBeans. It originally used a patched version of Tomcat 3. (early NetBeans 3.x releases). Tomcat Manager was added in Tomcat 4 and it was used because it was possible to integrate easily with your Tomcat installation without knowing much details about their setup. Start/stop Tomcat can use default scripts and will pick up your settings. Deploy does not need to care about access rights and it just assumes that manager works.

IBM RAD 7.5 ... why does it take WebSphere so long to start / publish / republish / debug?

I'm developing an EAR/WAR application with IBM RAD 7.5 and WebSphere 7.
When I run my app on WebSphere 7 within "eclispe", it take forever for WebSphere to start in "Run" mode (2 or 3 minutes). Much longer to start in "Debug" mode (5 to 10 minutes).
I have 'publish automatically' turned off, so I republish manually, and that too take a long long time.
Am I doing something wrong, or is there anyway to speed thing up?
Thanks,
Rob
Try setting metadata-complete="true" in your web.xml I experienced significant improvements doing this.
I wonder if you're hitting memory limits on your system and perhaps doing a lot of swapping. My WebSphere 6.1 under RAD 8 seems to start in an amount of time consistent with WebSphere by itself.
I would suggest you check the Heap for the test environment.
Personally build automatically and auto-publish should be turned off, You run the publish as and when you need it.
This one is still a good reference
http://www.ibm.com/developerworks/wikis/download/attachments/113606723/radtipsv754.pdf?version=1
Sometimes when it takes 5-10 to publish in debug mode, i either revert to export and install via the admin console or use wsadmin scripts to install the application.
Also turn on the heap config for RAD (one of the preference allows you to show this). You might be able to make some inferences if RAD is hitting into memory issues.
HTH
Manglu

How to Speed Up IBM Rational Application Developer/Rational Software Architect

I want to know how can I speed up RSA 7.5( which is an IDE by IBM having eclipse under the hood with websphere server runtimes) mainly server start. The first time I start it after computer reboot it loads after, but after that it takes for ever to start/stop the server. The debug mode for server takes for ever to start.
I am using server 7 run time for IBM RSA 7.5.
So bascially RAD/RSA has websphere run times which allows to configure the server runtime start/stop within RAD/RSA. The run time allows you to develop webapps and test time on the server on deploy it on the websphere run time.
The problem I am facing is with the websphere runtime which works fine after computer reboot but is very slow after several deployments/publishing of the same web app.
I would be grateful you give performance tips for speed up RSA server start/shutdown and overall performance tips. I have plenty of memory like 12 GB with i7 Core 6 cores on Win7.
Of course of your are running the server in debug mode it's going to be a lot slower, but you have a few options like putting the server in development mode or doing some fine tuning as to which applications should start. Take a look at these articles:
Rational Application Developer Performance Tips- Case study: Tuning WebSphere Application Server V7 and V8 for performance
Performance tuning WebSphere Application Server 7 on AIX 6.1
WebSphere tuning for the impatient: How to get 80% of the performance improvement with 20% of the effort
WebSphere Performance Monitoring & Tuning
Some of these are a bit dated but they have some good information that may still be relevent to your issues; especially the first one.
Make sure that the workspaces are stored on a local disk.
edit - forgot this: buy a SSD disk. It makes a huge difference when developing.
If you have a virus scanner, disable on-access scan in the SDP installation directory including the server plugin, and in all your workspaces.
Uninstall any applications (ears) you are not using - the more you have installed the longer the server takes to startup. If your server is taking too long to start, RAD/RSA will assume it has timed out and stop it before it finishes starting - if this happens then increase the start timeout limit by double-clicking your server in the Servers tab and modifying the values in the Timeouts section.
Oh, and If you have a lot of datasources defined, and autostarting connection pools with alot of connections, it may also take a while to start the pools.
But that can't explain it all... I haven't tested, but since WAS and RSA seems to spend a lot of time doing absolutely nothing, I am starting to suspect it's trying to download schemas or something. If you have the time, you could try to trace and see if you find something like that...
I came across this post while trying to troubleshoot my RSA performance. I figured I would update it with a recommendation for improving performance on RSA 8.0.4.
http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=/com.ibm.performance.doc/topics/cperformance.html has some excellent tips on improving performance in the "Performance Tips" section. After implementing just some of the "Always" tips I've found my memory reducing significantly and performance being much faster.
You should start with the "Always" tips and then move to the "Sometimes" and "Rarely" ones for finer tuning.

GWT hosted mode very slow

We do have problems with GWT hosted mode running in Eclipse Ganymede (Windwos XP 3GB RAM). When we start our application in hosted mode it takes very long to start and also the transactions once the application is started are taking minutes to react. It seems as if it takes very long to communicate between Javascript and server.
The processor shows almost no load during this time. Even compiling and starting from an external browser does not help.
Strange is that we do have two other computers (one Windows XP one Linux) with exact the same setup where the hosted mode is working at normal speed without any problems for the same application.
Do yourself a favour, move to GWT 2.0 (currently in RC2) and take advantage of Out Of Process Hosted Mode (OOPHM), which lets you debug straight in the browser, and is lightning fast!
http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM
Try removing all breakpoints. It helped me in such a scenario. Apparently if you place breakpoints in critical points in the program, it can cause everything to grind to nearly a halt in hosted mode.
I second the suggestion to switch to GWT 2. Please note, however, that with GWT 2, hosted mode is very slow in Chrome. I recently switched from 1.7 to 2.0 and found hosted mode to be very slow ... until I switched to Firefox. Reason for this is that Chrome's process model is not benificial to OOPHM, at least now.
A few ideas:
Does the slow Windows box have a heavily fragmented hard-drive?
Is it a specific database query that's taking a long time once the application is running, or are all interactions slow?
Are the project files on a local filesystem?
Is the database on a local filesystem?
If so, does it have the same size data set as the other machines?
If not, are they on different subnets or have different bandwidth available?