views:

1709

answers:

7

I am using Rational Application Developer v7.0 that ships with an integrated test environment. When I get to debugging my webapp, the server startup time in debug mode is close to 5-6 minutes - enough time to take a coffe break!

At times, it so pisses me off that I start cursing IBM for building an operating system! instead of an app server: Spawning 20+ processes and useless services with no documented configuration to tuning it, to starting any faster.

I am sure there are many java developers out there, who would agree with me on this. Now, I tried to disable the default apps and a set of services via my admin console, however, that hasn't helped much.

I have no webservices, no enterprise beans, no queues, just a simple web app which requires a connection pool. Have you done something in the past to make your integrated test environment, start fast in debug mode and there by consume less RAM?

UPDATE: I tried disabling a few services (internationaliztion, default apps etc...) and now the websphere server went from bad to worse. Not only doesn't it take horrifying startup time, it keeps freezing every now and then for upto 2 minutes. :-( Sounds like, optimization is not such a good thing, always!

A: 

If the connection pool really is the only appserver feature you use then why don't you simply use apache commons dbcp (http://commons.apache.org/dbcp/) drop webfear alltogether and use jetty instead. That should reduce your startup time to about 5 seconds. You can then later easily switch to websphere again for your production environment if you should really feel the need to.

mh0rkk
there are few services that I would want to use - JAAS for instance. I am not sure if I would be able to do that on jetty. And, its just a safe bet - you are saving yourself migration related issues.
Jay
+3  A: 

The best way to debug server code is to use remote debugging.

First you need to add the following to the JVM params in the server start script:

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

This will cause the JVM to listen on the specified port, then from your IDE you can start a remote debug session against that port and debug as if the code was running in the same process.

Working this way prevent you restarting the server so frequently and hence side-steps your problem with Websphere's start-up time.

You can get some odd results if the binaries on the server and the source in the IDE get out of sync but on the whole that's not a problem.

Nick Holt
How do I keep the source in the IDE in sync with the one in the remote debugger?
Jay
Hi Jay, simply redeploy when you make changes to your source. This may sound obvious but if you're doing TDD you occasionally forget (well I do) to deploy and find yourself tracing through comments or white-space in the IDE.
Nick Holt
+1  A: 

There's some hints and tips for tuning RAD 6 on developerworks that may help, many of these also apply for RAD 7.

I have seen a similar list for RAD 7, I'll post it if I can find it.

I did find some tuning tips for Portal on RAD 7.

I would say my experience with the test environment has been suboptimal. I now tend to use Tomcat/Pluto configured for remote debugging with an External launch configuration to manage it from within bare Eclipse and rely on having appropriate JNDI configurations to abstract the underlying server.

If you are coding to the relevant APIs it shouldn't matter for development purposes that you're not on Websphere. If you do have a Webpshere specific issue you can always crank up the beast to debug it.

Rich Seller
+1 this looks promising
Jack Leow
+2  A: 

5 to 6 mins is not normal. I use RAD and WAS everyday and get decent startup times. Which version of WAS are you running and how much RAM do you have?

If you share several workspaces and projects for a same WAS profile, consider creating a new WAS profile for your workspace.

You probably tried that but here's a simple check list of things to try on first hand: Make sure that your server settings in RAD has "Optimize server for testing and developing" checked, and "Run server with resources on the workspace" selected and "Minimize application files copied to the server" checked. Uncheck "Enable universal test client" if you don't need it. In the admin console you can verify some server settings such as "Run in development mode", "Parallel start" and "Start components as needed". You can also unistall the ivt app that comes installed by default when creating a new WAS profile. Then the usual things such as a drive that is not too fragemented and a pagefile size that is properly set.

And one last thing that you probably know already, Republish to your server instead of Restarting it.

svachon
+1  A: 

If you have no EJBs, no JMS, etc., just deploy under a standalone servlet container such as Tomcat or Jetty, you'll be amazed how fast it is :-), being ironic here but it's true!

+2  A: 

That's one reason why Spring was born.

You don't even have to give all the niceties like JMS, remoting, etc. You'd be better off with Tomcat, ActiveMQ, and OpenEJB.

Anything but WebSphere.

duffymo
A: 

WAS V7 addresses some of these problems by allowing you to configure what starts up when the app server starts up.

So if and when you migrate to WAS V7 you might seem some improvements in this space.

Manglu
Really could you explain where this gets configured and what is safe to turn off that you know about?
mugafuga