Tuesday 19 November 2013

Work Load Forecasting

Forecasting the projected volumes is one of the key elements for work load modeling. The forecasting process is a combination of using judgment and application of mathematics. The mathematical process takes past history and uses it to predict future events. Both these components should be used in order to come out with an accurate forecast.

For a Performance Engineer to intelligently negotiate an SLA, he or she must understand business- related concepts such as customer/employee population, inventory stocks, and business transaction rates. This kind of volume data is expressed in business units, the language of the user community. Performance Engineer must be able to communicate with the users in these terms. However, they also must be able to translate business units into measurements related to intensity of service demand (e.g. system arrival rates, transaction-processing time, etc.). Furthermore, these must be translated to system performance metrics such as utilization, queuing levels, and response time. In addition, Performance Engineers should realize that business trends are changing over time and that business growth rates will cause changes to system requirements. Therefore, estimating the computing needs of an organization requires application of forecasting techniques and relating these to the system performance metrics mentioned above. The combination of these skills form a discipline called capacity planning, is the determination of predicted future system needs which impacts system acquisition decisions and service level expectations.

Workload Forecasting Techniques:

There are two broad categories of forecasting techniques:

1.  Quantitative Methods

Quantitative methods are based on algorithms of varying complexity. Relies on the existence of historical data to estimate future values of workload parameters

2.  Qualitative Methods

Qualitative methods are based on educated guessing analogy/commercial knowledge. It’s a subjective process, based on judgments, intuition, expert opinions, historical data etc.

Quantitative Versus Qualitative:
Quantitative forecasting looks more into statistics and past trends to make predictions, whereas qualitative analysis relies more on managerial or judgmental opinion. Qualitative analysis is also often used when quantitative data is absent.

Quantitative forecasting techniques are generally more objective than their qualitative counterparts which are more subjective. Qualitative techniques are more useful in the earlier stages of the product life cycle, when less past data exists for use in quantitative methods

Quantitative methods come in two main types:

 Time-series methods

Time-series methods make forecasts based purely on historical patterns in the data. E.g. you want to forecast site visitors over the next few weeks. Time-series methods only use historical site visit data to make that forecast. Time-series methods are probably the simplest methods to deploy and can be quite accurate, particularly over the short term. Most quantitative forecasting methods try to explain patterns in historical data as a means of using those patterns to forecast future patterns. It can be further divided in to

Last period demand (often called the "naive" forecast)

 Arithmetic Average

Simple Moving Average (N-Period)
Weighted Moving Average (N-Period)

Simple Exponential Smoothing

Calculating Multiplicative Seasonal Indexes

Simple time-series methods include moving average models. In this case, the forecast is the average of the last "x" number of observations, where "x" is some suitable number. If you're forecasting monthly sales data, you might use a 12-month moving average, where the forecast for the next month is the average over the past year.

E.g. Ft+1 = Yt + Yt−1 + · · · + Yt−n+1/ n

where Ft+1 is the forecast value at time t + 1, Yt is the observation at time t and n is the number of observations used to calculate Ft+1

Trouble is, simple averaging methods don't tend to work well when there's either a trend in the data or seasonal effects. E.g. In case of marketing data, other techniques such as exponential smoothing may be more appropriate.

With moving averages, every data point carries equal weight in making the forecast whereas in case of smoothing methods, more importance is placed on the most recent data than on the historical data. If there's a trend in the data, it'll use the recent observations to make up the bulk of the forecast, and the forecast is more likely to reflect the trend.

Moving averages and simple exponential smoothing techniques are available in Excel and easy to execute. That's part of the great advantage of time-series methods: they're generally simple, cheap to run, and relatively easy to interpret.

 Explanatory methods

Explanatory forecasting methods take the process a step further and allow us to relate changes in marketing activity to changes in such outputs as sales, brand awareness, and registrations.

Explanatory models assume that the variable to be forecasted exhibits an explanatory relationship with one or more other variables. For example, we may model the electricity demand (ED) of a hot region during the summer period as

ED = f (current temperature, strength of economy, population, time of day, day of week, error)
The relationship is not exact—there will always be changes in electricity demand that cannot be accounted for by the variables in the model. The “error” term on the right allows for random variation and the effects of relevant variables not included in the model. Models in this class include regression models, additive models, and some kinds of neural networks.

The purpose of the explanatory model is to describe the form of the relationship and use it to forecast future values of the forecast variable. Under this model, any change in inputs will affect the output of the system in a predictable way, assuming that the explanatory relationship does not change.

Qualitative forecasting methods can be categorized further as below

Delphi method: It is an iterative technique for obtaining a consensus forecast from a group of experts, without the problems inherent in group decision-making. The procedure works as follows: first, give a set of questions to each expert, who provides answers (forecasts) independently from the other experts. The responses are collected and numeric responses are statistically summarized. If a consensus was not obtained, return the summarized responses to the experts, along with any comments made by the experts (anonymously), and have them revise their forecasts based on this data. Repeat until either a consensus is reached (the answers converge) or else a "stalemate" occurs (no convergence can be obtained).

Market research: Questionnaires and interviews are used to solicit potential customers, current users, and others. One potential problem is that stated intentions (expectations) do not always translate into behavior. E.g. questionnaires, test markets, surveys, etc.

Product life-cycle analogy: forecasts based on life-cycles of similar products, services, or processes.

Expert judgment by management, sales force, or other knowledgeable persons

Jboss monitoring using SIS (Integrating Site Scope with JBoss)

Below are the prerequisite configuration which required to setup the Jboss application server monitors

Step 1) check Jboss is running

Step 2) Add the below lines in “$JBOSS_HOME/bin”

On Windows: run.conf.bat 

set JAVA_OPTS="%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false"

set JAVA_OPTS="%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false"

set JAVA_OPTS="%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=portNo"

set JAVA_OPTS="%JAVA_OPTS% -Djboss.platform.mbeanserver"

Counterpart for “run.conf.bat” on UNIX is “run.conf”

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port= portNo "

#JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

Step 3) Re-strat the server

Step 4) Check the:-service:jmx:rmi:///jndi/rmi://host:port/jmxrmi

(Make sure that there, no space are there b\w the url) in jconsole

Step 5) follow the basic steps use and use JMX monitor

Step 6) paste:-service:jmx:rmi:///jndi/rmi://host:port/jmxrmi

Step 7) get the counters and select whichever u need

The above configuration can be used to setup the monitor for Tomcat

Enable Connection Pool :

need to deploy the xxxx-ds.xml file in to the jboss/server/default/deploy folder. You will get the sample xxxxxx-ds.xml files from the docs/examples/jca direcoty, that is coming along with the jboss build. To create oracle connection pool, you have to deploy the oracle-ds.xml (name doe's not mean much) in the jboss/server/default/deploy directory. (or in the instance which one you are using).

 
    OracleDS
    jdbc oracle:thin:@youroraclehost:1521:yoursid
    oracle.jdbc.driver.OracleDriver
    x
    y
    org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
 


Note:We will not be able to monitor Connection pool using any SIS below 11.2.SIS 11.2 comes with a patch which helps up to retrieve Connection pool from Jboss

Difference between Web_find and web_reg_find functions in load runner

SI no
Web_find
Web_reg_find
1
The web_find function searches an HTML page for a specified text string.
function registers a request to search for a text string on a Web page retrieved by the next action function, such as web_url.

2
This function is limited to HTML–based recorded scripts
It supports both html and url mode recording
3
Java or VB does’t support (only we can use with c prog lang scripts)
Support all lang
4
Runs slower
Run much faster than web_find
5
Does’t support WAP scripts running in HTTP or WSP replay mode.
-------

Note:
Web find is deprecated. It has been replaced with web_reg_find.
WSP-Wireless Session Protocol
WAP wireless application protocol 

Difference between web_url and web_link


Difference between web_url and Web_link are:


Sl no
Web_url
Web_link
1   
Loads the specified Web page (GET request).

Emulates a mouse click on the link that is defined by the attributes
2
It is not context based
It is context based (Context sensitive functions describe your actions in terms of GUI objects)
3
This one is support url based mode(URL based mode records each and every browser request to the server and resources received from the server)
It is HTML mode(HTML based mode does recording as you perform clicks and doesn’t give you inside information like what is happening behind the recording)
4
It will have more correlations to do comparing with the Web_link
It will have less or no correlation to do

Difference between socketlevel and WinInet modes in load runner

WinINet uses the Microsoft interface to the internet.
Starting with version 7, Load Runner uses Sockets mode replay by default.This was also known as Turbo replay. Socket/Turbo replay utilizes its own interface to the network card. This proprietary replay engine is a lighter engine that is scalable for load testing.

The older WinInet replay, which can be enabled in Load Runner by selecting "WinInet replay instead of Sockets (Windows only)", uses the Microsoft WinInet DLL to talk to the network card. The limitations of the WinInet replay engine are that it is not scalable, nor does it support UNIX. In
addition, when working with threads, the WinInet engine does not accurately emulate the modem speed and number of connections. However, The WinInet is the engine used by Internet Explorer. It supports all of the features incorporated into the Internet Explorer, and thus, WinInet replay can
resolve some replay errors.



 attribute : 
1) Additional attribute will be read from the run time settings of controller or VuGen.
2) We can pass the values to VuGen test script from the run time settings.
3) When you you change the value of the additional attribute, you do not have recompile or restore the test script in controller.

variable :
1) Variable will be defined in VuGen, based on the C data type.
2) Variable will be used for capturing any run time values or function return values.
3) When you change the value of the variable in the script, you have to recompile or restore the test script in controller.

parameter :
1) Parameter will be defined in VuGen to store parsed response results for server dynamic values like user session id, item id which are automatically generated by the server .
2) Parameter will be used in the subsequent requests to successfully play back the script with captured dynamic server values .
3) When you change the parameter settings, you have to recompile or restore the test script in controller

WinInet “weighs” more in terms of over all system resources as it is integrated with the Microsoft security APIs. The sockets option, what used to be known as Turbo load  was developed to allow for lighter weight virtual users to exist in larger quantities on a given reference hardware definition (Load Generator). The core change is on playback, if you need integration with the Microsoft security infrastructure, i.e. using web_set_user() you will need to use WinInet and you will need to use Windows Load Generators. And yes, these users will use more system resources.

The default is sockets. Unless you need to integrate directly with a security infrastructure for user authentication you will likely not need WinInet. You use this mostly when you have recording issues related to security, consider the use wininet as a workaround since the sockets mode with the required port mappings is the correct solution.


Note:When an application fail in recording, you can try by switching between the two modes. Whereas when the application fails in replay, try switching the modes also.