We deploy and debug a Jboss Seam 2.0 EAR app from within eclipse, booting it on Jboss AS 4.2.2. Right now we need to reboot it every time we change the message bundle, pages.xml, components.xml, or the model, which takes up to 45 seconds.
Is it possible to include aforementioned files in hot deployment, and what are the options for boosting boot speeds?
For a frame of reference, we work on Intel quad core 6600's or better, with at least 4GB of ram.
Edit: I'm looking for ways to improve both boot speed (thats the 45 seconds) besides hot deploying message bundle, pages.xml, components.xml etc.
This has been an outstanding issue for Seam for ages now : https://jira.jboss.org/jira/browse/EJBTHREE-1096
It's not a trick - more a method of working - but I have all of my UI code (page handlers etc) as POJOs so that they can be easily hot-deployed. Any more serious business logic I put in SLSB/SFSB and unit test them thoroughly so hopefully I have fewer deploys when testing the application via the UI.
Currently pages.xml can be hot deployed. I've read some solutions for reloading the message bundle but it's never bothered me enough to warrant further investigation.
When you say 'reboot' it sounds like you mean 'shut-down and re-start JBoss'.
You only have to force JBoss to reload the application, by touching the file (for an EAR or WAR archive) or the deployment descriptor (app.ear/META-INF/application.xml or app.war/WEB-INF/web.xml) for an exploded archive.
Reloading the Seam application EAR takes about 15 seconds on my machine, while starting JBoss takes about 30 seconds excluding shut-down but including starting the Seam application.
If you do want to restart JBoss, you can probably make it start faster by removing components you do not need in your development environment, such as JBossHA (high availability and clustering).
Since using JRebel with JBoss I have saved a lot of time.
http://www.zeroturnaround.com/jrebel/
It is not free but imho it is one of the tools that is worth the money and saves a lot of time restarting, redeploying an app after only a small change.
E.g. it reloads messages.properties.
What is it doing during those 45 seconds? If it is loading data from the hard drive then you could invest in a faster one. Non-SSD Hard drives are still a bottleneck these days. Although the time points out to some other issue...
I think it is best for you to open (or look for) an issue at:
https://jira.jboss.org/jira/browse/JBSEAM
(Note: For posting issues you need to login first.)
I've sped up boot time by moving to a war and stripping Jboss to a bare minimum (Since I'm only using seam POJOs and not EJBs).
Related
While developing Java EE applications, the NetBeans IDE (currently using 8.0.2 but the issue is not restricted/limited to this version only) issues a low memory message quite frequently.
For example, while modifying and saving some Java classes (especially, JPA entity classes), the memory soon gets over-flooded after repeating this modifying and saving process for merely 10 to 15 entity classes. The IDE issues a low memory message disturbing the whole system severely.
It leaves only one alternative which is to restart the system and I indeed have been wasting more time in restarting the system than actually developing Java EE applications for couple of years :). I have not yet seen anything about this issue over the internet.
The auto-deploy (Deploy on save) option on the IDE is turned off forever. I never use this facility as it causes the heap/PermGen space to get over-flooded quite soon.
This may or may not happen in small toy applications. I am only talking about Java EE applications using a Java EE compliant application server.
I see if there is no way to get around this problem, then this IDE cannot be used in developing real Java EE applications because dealing with this problem basically takes more time than the actual development time and otherwise, the solution may be to lean towards other IDEs like Eclipse, IntelliJ Idea, JDeveloper etc, if they go better.
I am currently using,
GlassFish Server 4.1/Java EE 7
JDK 8u45
NetBeans 8.0.2
Is there a solution somewhere in the world?
NetBeans tends to be slower than other IDEs on Windows but this is far beyond the single term slow.
The picture is taken from a simple test web application (thus not an enterprise application). In enterprise applications, changing a single character in a single entity class is not affordable. One is likely to run into a big problem, if attempted. Fixing those errors shown in the link may take hours or probably the whole day or so.
Not to mention again that I am not talking anything other than large scale applications involving Java EE or other platforms like Spring.
Long story short : Nothing can prevent me from wondering as to how it is affordable to use this IDE in software industries. It is no longer usable in this way (Nothing to abuse. Honestly, I kept patience for almost three years. I am merely wasting time using this IDE).
There is wonder question: how does number of deployed portlets affect on performance of Liferay?
If I have deployed 50 war projects (summary about 80 portlets), can it be cause of very slow performance?
Or will it only insignificantly affect on performance of Liferay?
The Number of deployed projects, extracted in tomcat/webapps, will affect dramatically your server startup time for sure.
Depending on the portlet scope and tasks they might add an overhead to your browsing performance, but I don't think it's a big deal as long as you don't have lots of them rendering in the same page.
Now, things are a lot harder in a development machine (the tomcat server is controlled by Eclipse and you have portlets auto-deploying in that server each time you compile or change them). A portlet's auto deployment can cause all the other webapps to deploy too. Also, in development mode, you might experience permGen errors quite regularly, and in this case, since you're gonna have to restart the server each time, the huge startup time can become a major pain.
If you're in a development environment , you should really consider removing the webapps that are not beeing tested or needed.
I have a simple maven - Java EE web application which I develop using IntelliJ and deploy to Glassfish server. The thing is, it takes about 15 seconds to deploy. I know it is not too long, but I am trying to make it even faster.
I installed RAMDISK and moved my project into that disk, it did not help. Then I moved Glassfish in the RAMDISK as well, however there was still no change in the performance.
Do I need to move JDK, JRE to the RAMDISK as well to see the change? Or even the IDE itself?
Why did not moving the project and the glassfish to RAMDISK make any change?
Thanks.
Btw , for CLOSE question fans, there are question like this:
Can I use a RAM disk to speed up my IDE?
Close those first.
Perhaps your speed problem is not related to the disk. Maybe use a profiler to see where the time is actually being spent, and then optimize the slowest part. Repeat until startup is fast enough.
I use Seam3 + maven + jboss7 combination in my development. Would it be possible to optimize the loadup time when I do
mvn clean package jboss-as:redeploy
Currently this takes over 20 seconds with core2duo with an SSD (Mac Air).
In my workflow, it's common to make a lot of small changes and then redeploy and see changes. It's quite a big bottleneck with current setup, and it breaks my flow.
Would it be possible to do proper hot-deployment over my configuration?
Is there parameters for making startup faster when developing?
There is no hot-deployment. I'm not sure why it would be taking 20 seconds either. I get around a 3 second start-up time with JBoss AS7 and my deployment times are around 1 second maven deployments.
Is the server running locally or on a different machine? It could be the time it takes over the network.
You can write custom deployment scripts or write custom Java code to deploy applications as well.
I found about JRebel. It's a gift that I would not have expected to fall upon me. This supports my workflow and makes me much more efficient. If you need hot-deployment, try it out!
How can I improve performance when developing locally with Websphere and RAD? I am using one web application of moderate size (1000? classes) and it is impossible to handle the app locally on a Windows box. The Websphere 6.1 configuration uses the default configs. RAD7 is configured to handle a max heap of 1024mb. I thought about increasing the heap of the server. At present, the min and max are 128/300mb.
In terms of unresponsiveness, sometimes it may take minutes to load a page, if the page loads at all. Also, I disabled "Build Automatically" and Publish Automatically. Maybe those should be turned on?
I'm not sure about RAD7 but from my past experience, I'd suggest to give MyEclipse Blue a try.
Since that might not be an option, here are some other usual culprits, you can check:
How much RAM does your machine have? It's good to give WS 1GB of RAM but if your computer only has 1GB of real RAM, it's going to swap itself to death. If your boss won't pay for it, go get some RAM with your own money. 2GB are less than $80 ATM. I suggest to get at least 4GB. Yes, Windows can only use 3.5GB even when 4 are installed but that half GB costs $20 or less. Even thinking about this for more than five minutes will cost more than simply buying it.
Next make sure whether you are using the correct Java GC options. There should be some info about this in the docs. Plus make sure that the process uses the "jvm.dll" from the "server" directory, not the "client" one. "Process Explorer" will help.
Since I'm not using RAD, I'm not 100% sure about "Build Automatically" and "Publish Automatically" but since RAD7 is based on Eclipse, these options will compile code in the background as you type. This will greatly reduce the time between you saving your last change and the moment the app server can start to load the new code.
When all else fails, run websphere in a profiler and look where it spends all the time.
Aaron had great advice.
I would also suggest using JConsole to see what is going on, to help you determine if you need more memory, larger heap size, etc. My experience with running Websphere and RAD locally is that it will be slow, but then I was on an old machine that needed more memory. :)
http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html
Berlin,
RAD 7 saps your PC! When I was using it to develop Portlets, I followed this optimization guide and it made the IDE significantly quicker to develop Portlets in. Obviously it is aimed at Portlet development but it might help you.
Also following the advice given to the answer to this question will also help.
I definitely agree with Aaron Digulla. You will see a major performance improvement with 4GB RAM installed on your development machine. I developed an Eclipse/RAD plugin with some buddies of mine and we were able to measure how much time we saved by upgrading from 2GB to 4GB.
The plugin is available here: http://lopb.org/
After gathering some hard numbers on how much time we spent waiting for publishing and loading the app on our 2GB development machines, we were able to convince management to upgrade the rest of the developers on the team.
Anyway, you should really consider upgrading to 4GB if you want to run RAD 7 and Websphere 6 on the same development machine. Each one needs -Xms=512m -Xmx=1024m as JVM args to run well, and that means you will swap to disk way too much if you only have 2GB of RAM or less. HTH
Make sure your running was in development mode for your development and testing.
Option is under the server in the console.
Karl
hehe, we had the same problem with RAD6 and Websphere 6.
The way we speeded things up is moved to Eclipse and JBoss.
We developed on Eclipse and JBoss and then first round of testing was on Websphere. We had some issues with the differences but would never had completed the project were it not for out switch (a lot fewer issues than deving on RAD/WAS).
But to help you in the mean time...
Definitely, probably want build automatically and publish automatically off. That way you can make a bunch of changes and then tell RAD to compile and deploy while you go and get coffee.
There is a "run in dev mode" in Websphere (I know there was for 6.0) so track that down and turn it on (it's on the WAS console somewhere)
I found WAS's on stack replacement to work fairly well. I found that at the beginning of the day I'd deploy to WAS and then not have to redeploy at least until lunch time (as I was debugging). I would make changes and the changes would be fed to the server without my having to redeploy.
Chances are, even after running the profiler you'll find there's nothing much that you can do..
Turn off all validations (in RAD), they tend to take forever.
Depending on what you're doing with EE investigate the possibility of deving on another IDE/Server combo, maybe you can do the bulk of your work in there and then deploy from RAD/WAS to do some final testing. If you're using vanilla ejb's or web services this is feasible.
That max heap does sound a bit small to me. The suggestion to fire up JConsole is a good one cause it will tell you how much heap is being used, though I'm not sure if it will work on the IBM vm (RAD's). You might try and turn on the memory usage monitor in RAD, tells you how much memory is being used, that way you can tell if it's hitting the max.
JConsole will not work without specifically enabling it via a JVM command line switch.
Suggestions from Michael Wiles sound reasonable but please update your RAD first to the latest FixPack available.
You can also contact support.