Thursday 3 November 2011

Intereview Questions


Q: What do you mean by weighted based server instance? How do you configure it?
Ans: The Weblogic Servers in the clustered environment could be routed in 6 ways ROUND-ROBIN, WEIGHT-BASED, RANDOM and same algorithms with Affinity. Weight is defined as the number of the requests incoming to a managed server that is default 100. As per the machine capacity and Operating environments will make you to deside how much weight is suggested on that managed server. We can control the incoming requests using weights increase or decrease, So, this way we can route all the request to one of the managed server in the Cluster. This Weight differences can be used when there is operating environment differences are there.
Q: what is the source to identifying the Connection pool failure? What is the remedy?
Ans: In WL 7/8 to identify the Connection pool failure we have 3 options:
1.The Connection pool hosting Server instance healthchecking by Monitoring tab where we need to find the idle thread availability.2. Checking in the weblogic log of that corresponding server instance. Usually we get broken pipe Exception.This could be generated due to overload on connection pool. To resolve we can tune the execute threads for the corresponding server instance.3. Look for Thread dump and identify the which thread is doing which task execution?
2.      What is the difference in the web.xml and weblogic.xml?
 
An application-specific XML-based deployment descriptor file named web.xml, which lists your application's J2EE components and their configurations as J2EE modules. Each J2EE module is a collection of one or more J2EE components of the same container type (Web or EJB) that are represented by one component deployment descriptor for that type in the web.xml file.
 
 A WebLogic-specific deployment descriptor file named weblogic.xml, which defines how named resources in the web.xml file are mapped to WebLogic Server resources. Examples of weblogic.xml attributes include HTTP session parameters, HTTP cookie parameters, JSP parameters, resource references, security role assignments, and container attributes.
 
3.      Which is the default JVM used for Weblogic?
 
Hotspot Sun JDK if you want to change you need to specify it.

4.      How to change from default JVM to other?
 
When you upgrade a domain to WebLogic Server 8.1, consider upgrading your JVM to JRockit. WebLogic JRockit is a JVM designed for running server-side applications in Windows and Linux running on Intel architectures. For server-side applications, JRockit has these advantages over other virtual machines:
 
It employs adaptive optimization, which detects and removes bottlenecks in the deployed application.

It is designed specifically for the special requirements of server-side applications, which tend to be parallel and thread-intensive, to run for longer periods of time, and not to use graphical interfaces.

You can monitor JRockit using the WebLogic Server Administration Console.

Steps to change:
 
In the server start scripts, set JAVA_HOME (or equivalent) shell variables to point to the JRockit root directory. For example, change:
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jdk131
 
where WL_HOME is the WebLogic Server 7.0 installation directory, to
@rem Set user-defined variables.
set JAVA_HOME=WL_HOME\jrockit81_141_02
 
where WL_HOME is the WebLogic Server 8.1 installation directory.
 
Change the domain’s config.xml to use the JRockit javac.exe. For example, change
JavaCompiler="WL_HOME\jdk131\bin\javac"
 
where WL_HOME is the WebLogic Server 7.0 installation directory, to
JavaCompiler=WL_HOME\jrockit81_141_02\bin\javac”
where WL_HOME is the WebLogic Server 8.1 installation directory.
 
Remove from server start scripts any switches specific to the Sun JVM. For example, from
the start command:
echo on "%JAVA_HOME%\bin\java" -hotspot .... weblogic.Server
delete “-hotspot”.

8.      What are the modes of operation for Weblogic server domains?
 
There are two modes: Development and production mode:

Development mode:
  1. You use development mode while you are developing your applications. Development mode uses a relaxed security configuration and enables you to auto-deploy applications.
  2. You can use the demonstration digital certificates provided by the WebLogic Server security services. With these certificates, you can design your application to work within environments secured by SSL.
  3. WebLogic Server instances can automatically deploy and update applications that reside in the domain_name/applications directory.
  4. When you start a server, the server automatically renames (rotates) its local server log file as server-name.log.n. For the remainder of the server session, the server rotates its local log file whenever the size of the file reaches 500 kilobytes.
  5. The default number of threads available to Execute Queues is 15.
 
The default capacity is 15 JDBC connections.

Production mode:
 
  1. You use production mode when your application is running in its final form. A production domain uses full security and may use clusters or other advanced features.
  2. A warning message is displayed if you use the demonstration digital certificates.
  3. The auto-deployment feature is disabled, so you must use the WebLogic Server Administration Console or the weblogic.Deployer tool.
  4. A server rotates its local log file after the size of the file reaches 500 kilobytes.
  5. The default number of threads available to Execute Queues is 25.
  6. The default capacity is 25 JDBC connections.

5. What are the tuning techniques you applied?
Tunning for JVM - chanigng -Xmx, -Xms, MaxNewSize, MaxPermSize, and if required GC algorithms
Tuning in Threads/ThreadPool -- Defining Workmanager with maximum constraint
Tuning TCP/IP connections Interface address, backlog count,
Tuing  JMS  -- changing queue sizes as required
Tuing JDBC - initial count, maximum capacity, increase by number of connections
11.  What are the difference between Connection pool and data source?
ConnectionPool is physically connects to the Database. where as Data Source is a logical resource that can be used by developer or any other resource for accessing Connection of pools.
DataSource can be associated with JNDI name that is used for lookup from from any other client.


14. What is cluster and how do you configure?
Cluster is a group of managed servers.
Using console
Usning WLST
You need to provide the Multicast address, Multicast port, Cluster Address which is nothing but the listen addresses, listen port of all managed servers need to group together.
15.  What is the use of multicast address?
In a WebLogic domain to broadcast the heart beat message to all cluster members. TTL will be send to the multicast address, to this address all the cluster members are subscribers. If one of the Server crashes that can be notified by all other members by missing 3 times heart -beat. So that secondary server will takeover the request and start working with the replication data.
16. How to get thread dump and what the purpose of stuck thread?
Get the java process id, you can get it by jps or customized script for it.
kill -3 pid for unix env.
Ctrl+break for windows env.
When there is a Stuck Thread need to monitor the log for few minutes some times 2 or 3 stuck threads hogging but after sometime it will be  unstucked. If you take multiple thread dump for every 5 sec gap and analyse with sumarai or Java Thread Analyzer tool you will get to know why it is stuck what is causing the instances to mis behave that time.

No comments:

Post a Comment