Lightweight WebLogic development environment - java

We just started a project in ADF, Oracle's Java EE framework. Usually we develop in Tomcat, then deploy into the production WebLogic servers.
But we realized ADF requires a WebLogic server installed locally to develop in Eclipse/JDeveloper. This is really heavyweight, even configured as dev, it is killing our machines, and taking a long time to deploy.
So, are there any configuration parameters we could tweak so WebLogic takes as few resources as possible? Are there any alternatives we could use?
We are mostly concerned about memory (it is taking a wonderful 800MB,) and startup time (~2 minutes)

On the memory consumption issue, you might want to try setting the memory parameters of the JVM used by your WebLogic server. Log in to your WL Web Admin Console and go to Environment/Servers/[your server]/Configuration/Server Start and, on the "Arguments", setting something like -Xms256m -Xmx256m will set your JVM's initial (Xms) and maximum (Xmx) heap size to 256 megabytes. You will want to play around with these numbers and find the best values for your environment. But please be aware that your Eclipse instance might be consuming a lot of memory as well.
Regarding the startup time, although a bit larger than I would expect, they seem OK. This problem is very frequent, and I don't think you will be able to definitely solve it. WebLogic has much more features than Tomcat, and this reflects in other characteristics of the environment (like startup time). You might find some useful tips here, though: Speed up Weblogic Server startup times

There is no restriction to use a local server for development. You can always go for a shared server and deploy your projects for testing.

I agree with the previous post. If memory is a concern then you may install a stand alone WLS and deploy to it from an EAR. Make sure for the stand alone WLS you install the Application Development Runtime Libraries as by default WLS does not have domains enabled for ADF - http://www.oracle.com/technetwork/developer-tools/adf/downloads/index.html
When you install WLS, make sure you install it in development mode (which is setting the embedded WLS has too)
Beside of this, there is not much you can do to start WLS withlimited functionality.
Frank

Related

Performance Management Tool for 2 or more applications

I am working on an enterprise application which earlier used MyEclipse tool for Java / Java EE development, EJB 2.1 and WAS 7.0, recently we migrated to EJB 3.1, Websphere 8.5.5 and Eclipse Kepler. Now, we have noticed the performance of the application has increased and the screens load faster.
Now the problem that I am facing is to compare the earlier application with the one we've upgraded to and identify those areas which has led to speed up of the application. There are no performance metrics recorded for this application till date so I don't have anything to compare with.
All I am thinking was to have the Pre-Upgraded application deployed on a box and the Post-Upgrade application on the other box and record the time of load of all the screens. Now, this is not as subtle as being thought, so would like to know from you guys if there are any tools or strategies to compare two working applications and give performance metrics based on EJB methods time, JSP load time, Business Logic time, Database operations which gives true benefit analysis of the upgrade.
Also, do you guys think upgrade of application server and Integrated Development Environment (Eclipse Kepler) might have contributed to this speed?
If you still have both environments (WAS 7 and WAS 8.5.5) and some load scripts, I'd suggest to use PMI (Performance monitoring infrastructure) in WAS. You can enable metrics that interests you, set data to be saved to the log and run tests on both environments. Then you will be able to see gathered metrics for both environments.
The other option could be free WebSphere Application Server Performance Tuning Toolkit, which can be used to gather the performance data. Available either as standalone (older version) or as plugin to IBM Support Assistant (ISA).
Could upgrade of application server and Integrated
Developement Environment (Eclipse Kepler) might have contributed to
this speed?
Sure. The WAS 8.5.5 is in general faster than v7.0. For example it by default is using genCon garbage collection policy, which in most cases is more efficient that optthroughput.
The dev environment has no impact on application runtime performance, but maybe it is more responsive during development and thats why you have the 'faster' feeling.
I think what you need is benchmarking of both the versions of application and then compare both to see improvement.
for comparing both versions follow below approach,
Deploy both versions on exactly similar hw to create difference instance of 2 versions
Identify workflows/scenarios in which you found improvement and scenarios which are important for your application(mostly used/heavy/important for client etc.)
Carry out performance test/load test on those scenarios on both versions
Measure response time for all pages as well as system metrics i.e. cpu,memory,paging,disk etc.
Based on both versions results, carry out analysis and compare the both the versions.
If required carry out performance tuning and optimization round to improve the results.
This was about strategy.
For tools,
Check Ganglia,munin,graphite,carbon,sar,perfmon,nmon for system metrics (if its a cluster then RRD tools like ganglia,munin are better and if its a single box instance then sar for linux will do and on windows perfmon will do.)
For Load testing, JMeter is better option but you have quite enough funding then go for loadrunner,neoload,rational performance tester and for cloud, try blazemeter
For J2EE level analysis, IBM health center is available (according to me very inefficient to use), JProfiler, yourkit, jvisualvm are available
For WAS, Performance Monitoring Infra. is available with standard options it has low overhead but if you increase the logging counters and levels and it has huge performance impact.
I hope things are clear now :)

Tomcat 6 Web Application Eating Up Memory Over Time

I have a Grails application that is deployed on a Tomcat 6 server. The application runs fine for a while ( a day or two), but slowly eats up more and more memory over time until it grinds to a halt and then surpasses the maximum value. Once I restart the container, everything is fine. I have been verifying this with the grails JavaMelody plugin as well as the Application Info plugin, but I need help in determining what I should be looking for.
It sounds like an application leak, but to my knowledge there is no access to any unmanaged resources. Also, the Hibernate cache seems to be in check. It looks like if I run the garbage collector I get a decent chunk of memory back, but I don't know how to do this sustainably.
So:
How can I use these (or other) monitoring tools to figure out where the problem is?
Is there any other advice that could help me?
Thanks so much.
EDIT
I am using Grails 1.3.7 and I am using the Quartz plugin.
You can use the VisualVM application in the Oracle JDK to attach to the Tomcat instance while running (if using Oracle JVM already) to inspect what goes on. The memory profiler can tell you quite a bit and point you in the right direction. You most likely look for either objects that grow or types of objects that get allocated more and more.
If you need more than the free VisualVM application can tell you, a commercial profiler may be useful.
Depending on your usage of Quartz it may be directly related to a know memory leak with the Quartz plugin with persistence and thread-local. You may want to double check and see if this applies to your situation.

Running webapps in separate processes

I'd like to run a web container where each webapp runs in its own process (JVM). Incoming requests get forwarded by a proxy webapp running on port 80 to individual webapps, each (webapp) running on its own port in its own JVM.
This will solve three problems:
Webapps using JNI (where the JNI code changes between restarts) cannot be restarted. There is no way to guarantee that the old webapp has been garbage-collected before loading the new webapp, so when the code invokes System.loadLibrary() the JVM throws: java.lang.UnsatisfiedLinkError: Native Library x already loaded in another classloader.
Libraries leak memory every time a webapp is reloaded, eventually forcing a full server restart. Tomcat has made headway in addressing this problem but it will never be completely fixed.
Faster restarts. The mechanism I'm proposing would allow near-instant webapp restarts. We no longer have to wait for the old webapp to finish unloading, which is the slowest part.
I've posted a RFE here and here. I'd like to know what you think.
Does any existing web container do this today?
I'm closing this question because I seem to have run into a dead end: http://tomcat.10.n6.nabble.com/One-process-per-webapp-td2084881.html
As a workaround, I'm manually launching a separate Jetty instance per webapp.
Can't you just deploy one app per container and then use DNS entries and reverse proxies to do the exact same thing? I believe Weblogic has something like this in the form of managed domains.
No, AFAIK, none of them do, probably because Java web containers emphasize following the servlet API - which spins off a thread per http request. What you want would be a fork at the JVM level - and that simply isn't a standard Java idiom.
If I understand correctly you are asking for the standard features for enterprise quality servers such IBM's WebSphere Network Deployment (disclaimer I work for IBM) where you can distribute applications across many JVMs, and those JVMs can in fact be distributed across many physical machines.
I'm not sure that your fundamental premise is correct though. It's not necessary to restart a whole JVM in order to deploy a new version of an application. Many app servers will use a class-loader strategy that allows them to discard a version of an app and load a new one.

Weblogic administration console way too slow

I've installed weblogic 10.3.3, configured simple domain with default configuration. And after starting weblogic I cannot use it via admin console because it is starting too slow (~10 mins). It seems that admin console application is being deployed incorrectly. Even when I enable 'staging' mode in AdminConsole deployment options, it does not help. Does anybody have a solution for this problem? It really bugs me out.
Configuration properties:
Server: Dell PowerEdge r410 server (Six-core Intel® Xeon® x64 CPU, 8GB RAM)
OS: Ubuntu Maverick 10.10 x86_64
Weblogic: 10.3.3 x64 (used wls1033_generic.jar file for installation)
Java: 1.6.0_17_i586 (tried with different jdk's including x64, but it does not work either)
Turns out weblogic uses random number generator during startup. Because of the bug in java it reads random bits from /dev/random. There are almost no problems with /dev/random except that it is extremely slow. It takes sometimes 10 minutes or more to generate one number. Simple solution exists – using /dev/urandom instead. It is not that good as /dev/random, but at least it is instant.
Java somehow maps /dev/urandom file to /dev/random. That’s why default settings in $JAVA_HOME/jre/lib/security/java.security are useless, they just do not make any sense.
Problem fix is very simple – adding string export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom" to the /etc/bash.bashrc file. Usage of /dev/./urandom instead of simple /dev/urandom is another hack. JVM does not understand the option value otherwise.
Be aware of this problem if you try to setup weblogic under UNIX-based OS.
Without looking at the startup logs we could only speculate. Weblogic typically is a beast. It typically takes anywhere fromo 6-8 minutes to start up for me on my development machines, but that seems like a nice server for it to take 10 minutes for you.
The Admin Console should not be this slow, nor should it take 6-8 minute to start a server or deploy the Admin Console. The deployment of the admin console on my machine takes less than 30 seconds, and startup is under 60 seconds. Startup time for WebLogic is a common complaint, but chances are that something is misconfigured if there is a very long startup or admin console deployment time.

low end virtual private server for java development

Will a vps with 360 megs of ram running Linux be able to support a single user developing a java web application that uses Spring, Hibernate, and MySQL for the database? The server will be for development only so the application will not have more then one or two concurrent users.
edit:
By development I mean a server I can deploy and test on. The actual coding will be done on windows, but I want a Linux server to test on as well.
This could work ok, but it depends a lot on your application setup. If you cache a lot, your appserver caching page content, Hibernate caching query results/objects or MySQL caching query results you probably will need more RAM. So if your content is big it might not fit, otherwise it might just fit. If you have absulutely no option of increasing the amount of memory if you find out you need more I would certainly not recommend this setup.
But maybe more to the point: What is your target platform? I would say that your server should match that.
Just for linux testing it probably is easier to either get a cheap pc or run it inside a virtual machine on your development machine (assuming you've got plenty of ram on that one).
Depends on what you're running for your IDE. If you're using Eclipse, you're going to want somewhere around 1Gb of RAM (Eclipse is a memory hog...and slow as all hell if you don't have enough).
If you're using a more efficient (memory wise) IDE, then you should be good to go with that setup for development.
UPDATE
Since no coding is going to happen on the box...you should be just fine with that box to do your testing. Enjoy!
Short answer - I don't think you will have any problems with the amount of ram. I've deployed a rails app to a 256MB VPS and it worked great for development.

Categories

Resources