Tuesday, April 30, 2013

Process vs Thread

Process 1 and process 2 are two tasks, In OS level ,at a given time once process can executes (if is has only one processor). So each process has it own address space,file descriptor and stack. while process 1 is waiting for some information from disk then process 2 will execute.
Here are some performance drawbacks while executing process 2 
1.Context switch happens (means process 1 in wait state so next process (process 2) will execute)
2.While context switch happens at that time OS will save previous process information like sate of process and ....

But Threads are sharing the address space,file descriptor and stack and there is no context switch between the thread switching.

So threads are light weight process, so LR has these two features

Wednesday, April 3, 2013

Apache config for Worker MPM vs Prefork MPM

Some installations of Apache will have been compiled to work with either Prefork or Worker MPM, but most by default are compiled only to work with Prefork. Changing to Worker MPM may allow your server to handle much higher traffic, more user sessions, with less RAM use. Your site or server will not scale well if it is running Prefork MPM. Worker is a bit more difficult to set up properly, and has some restrictions regarding functionality of PHP scripts.

To determine which MPM is currently running 
/usr/sbin/apachectl -l
If you see worker.c in the list of loaded modules, your Apache is running Worker MPM.
 If prefork.c, it is running prefork.






Tuesday, April 2, 2013

What is concurrent users and simultaneous users ?

For example, axis bank application has below transactions
                           1. Login
                           2. Account summary
 ---------------------------Transfer money Action ---------
                           3. Click Transfer funds
                           4. Select "Beneficiary"
                           5. Enter "Amount"
                           6. Transfer
                           7. Enter "User id" and  Password and click "Confirm"
--------------------------------------Transfer Money Action end--------
                           8.Logout

So we have 8 transaction for this application and we have one Action (Transfer Money is one action but in that action you can have 5 transaction).

Concurrency : Performing same activity at a time by all users.Mean 100 users are login into the application at a time. But simultaneous users are login into the application one by one. Concurrency has various levels
          1.Transaction concurrency 
          2.Business Process Concurrency 
          3.Application Concurrency 


Transaction concurrency :
We need to test the application with 100 concurrent users, Means "All users(100 users) should perform the same transaction (login or   Account summary .... or  Logout) at a time" this is called transaction level concurrency.

Business Process Concurrency:

We need to test the application with 100 concurrent users for Transfer money Business action, means  "All users(100 users) should perform the same Transfer money action (here may be 30 users are clicking "transfer funds, 20 users are on selecting "Beneficiary", 20 users are in enter "Amount" page,10 users are in "Transfer" page  and 20 users are Enter "User id" and  Password and click "Confirm" ). 

Overall 100 users should be in transfer money action.


Application Concurrency :
All 100 users should perform different transaction or same transaction but at any time 100 user should be accessing the application.


Simultaneous users: All 100 users are login into the application one by one.