AppServer Launch Changes in 9.1
Appserver launching has changed significantly as of build 26. It is now far easier to understand and debug.
P1-cli ---> p2-ss ---> P3-PL ---> P4-AS9.1
Non-Native Start or Stop:
In the beginning...
Before build 26 of 9.1 all server launches involved running shell scripts in external processes. There were a number of reasons for doing this which aren't worth getting into. 4-7 processes were involved in both starting and stopping servers. Here is a simple diagram of how that worked
Legend:
- pX == process #x
- ss is the startserv script
- cli is asadmin
- PL is ProcessLauncher class running in its own JVM
- AS is a DAS, NodeAgent or Instance
- ASL is appservLauncher, a "C" program
- ASX is appserv, appservDAS, or appservAgent -- all "C" programs
P1-cli ---> p2-ss ---> P3-PL ---> P4-AS
Native Start or Stop:
P1-cli ---> p2-ss ---> P3-ASL ---> P4-ASX ---> P5-ss --->P6-PL ---> P7-AS
Imagine how difficult this was to debug! One had to echo messages from the scripts to a file, add java debug arguments to the java invocations in the scripts, change the C-code to force it to break so a debugger could be attached, etc., etc. I.e. it was virtually impossible to debug the startup or shutdown end to end!
9.1
Non-Native Start or Stop:
P1-cli ---> P2-AS
Native Start or Stop:
P1-cli ---> P2-ASL ---> P3-ASX ---> P4-AS
- asadmin no longer uses any scripts (i.e. startserv) to start and stop servers
- the startserv scripts are now fully functional and supported for use from a commandline
- the startserv scripts can get the username and passwords directly from the user
- Any server can be started from arbitrary java code directly (look in the startserv script to see how)
- The domains are completely relocatable to a different location on the same machine or to a different machine altogether. This automatically makes Appserver Backup and Restore more useful as well.
- Native launching is temporarily broken (set native launching to false in install-dir/config/asenv.bat or asenv.conf). It works fine on Windows though.
- Shutdown has been dramatically improved. It used to require between 2 and 6 external processes (for non-native and native respectively) to be started. Now it doesn't start any external processes so it is much faster.
- To compare new with old, set OLD_LAUNCHER=true in your OS environment. In this case, the scripts will run in multiple processes as before but the scripts are pointing at new code instead of old code. This only works for startup -- shutdown always uses new code.
Performance Checking
Procedure
I used ancient technology -- a stopwatch -- which is exactly the kind of time we want to measure. I.e. how long is the user sitting there looking at a blank screen. In the case of stopping a node agent it was so fast that I added code to do the timing internally in the java code.Notes:
- The table appears at the very end of this blog, I don't know why.
- All times are the average of at least 3 separate trials.
- The tests were performed on Solaris10-Sparc
- The domain startup became slower from build 19 to build 26 because of other modules in AS. Look at the times between Build 26 and Build 26 with scripts. This compares the all-java startups with java and script startups in the same build.
Observations and Conclusions
- stop commands are dramatically faster
- The new startup shaves 1-2 seconds off the total time. This is much more obvious when you look at start-node-agent which is much more lightweight than DAS.
- The new code is much easier to understand and debug.
| Build 19 | Build 26 | Build 26 with Script | |
|---|---|---|---|
| start-domain | 26.2 | 31.2 | 32.2 |
| stop-domain | 11.8 | 7.1 | NA |
| start-node-agent | 7.7 | 6.1 | NotDoneYet |
| stop-node-agent | 5.9 | 0.82 | NotDoneYet |