Monday, November 5, 2012

SETTING UP RAID 5 ON CLOUD / Amazon Linux. EC2

Few Days Back i was asked to optimize one of the elastic Search Node. I Identified one of the BottleNecks in DISKIO. Went to solve it with 5 disk with 4 stripes and 1 parity.

 

SETTING RAID LEVEL 5

INSTANCE

~$ ec2-describe-instances | grep XX.XX.XX.XXX
INSTANCE i-axxxxxxx ami-0xxxxxxx running Pradeep-Keys 0 m1.large 2012-10-30T11:44:20+0000 us-east-1c  monitoring-disabled XXXX vpc-sdsd2 subnet-1dsdsdsd ebs paravirtual xen sCFML1351596348533 sg-a99f80c5, sg-7ea0bf12 default false
NIC eni-4c1sdsds7 subnet-1dsdsd vpc-sdsd2 323323244233 in-use XX.XX.XX.XXX true
PRIVATEIPADDRESS XX.XX.XX.XXX

CREATING DISKS

~$ ec2-create-volume -s 128 -z us-east-1c
VOLUME vol-0 128 us-east-1c creating 2012-11-05T09:50:30+0000 standard
~$ ec2-create-volume -s 128 -z us-east-1c
VOLUME vol-4 128 us-east-1c creating 2012-11-05T09:51:08+0000 standard
~$ ec2-create-volume -s 128 -z us-east-1c
VOLUME vol-1 128 us-east-1c creating 2012-11-05T09:51:13+0000 standard
~$ ec2-create-volume -s 128 -z us-east-1c
VOLUME vol-5 128 us-east-1c creating 2012-11-05T09:51:17+0000 standard
~$ ec2-create-volume -s 128 -z us-east-1c
VOLUME vol-8 128 us-east-1c creating 2012-11-05T09:51:22+0000 standard

ATTACH THE VOLUMES

saurajeet.d:~$ ec2-attach-volume vol-0 -i i-axxxxxxx -d sdf 
ATTACHMENT vol-0 i-axxxxxxx sdf attaching 2012-11-05T10:02:43+0000
saurajeet.d:~$ ec2-attach-volume vol-4 -i i-axxxxxxx -d sdg
ATTACHMENT vol-4 i-axxxxxxx sdg attaching 2012-11-05T10:03:35+0000
saurajeet.d:~$ ec2-attach-volume vol-1 -i i-axxxxxxx -d sdh
ATTACHMENT vol-1 i-axxxxxxx sdh attaching 2012-11-05T10:04:13+0000
saurajeet.d:~$ ec2-attach-volume vol-5 -i i-axxxxxxx -d sdi
ATTACHMENT vol-5 i-axxxxxxx sdi attaching 2012-11-05T10:04:49+0000
saurajeet.d:~$ ec2-attach-volume vol-8 -i i-axxxxxxx -d sdj
ATTACHMENT vol-8 i-axxxxxxx sdj attaching 2012-11-05T10:05:19+0000

STARTING THE RAID SERVICE 

[saurajeet.d@es1 ~]$ sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=5 /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi /dev/xvdj
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 512K
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: size set to 134216192K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
[saurajeet.d@es1 ~]$

SET THE ARRAY TO START AT BOOT, THEREBY POPULATING THE CONF FILE

[saurajeet.d@es1 ~]$ sudo mdadm --detail --scan 
ARRAY /dev/md0 metadata=1.2 spares=1 name=0 UUID=e47f9d29:cf9f0299:e2305a7c:0d03d014
  
[saurajeet.d@es1 ~]$ sudo vim /etc/mdadm.conf
[saurajeet.d@es1 ~]$ cat /etc/mdadm.conf 
DEVICE /dev/xvd[f-j]
ARRAY /dev/md0 metadata=1.2 spares=1 name=0 UUID=e47f9d29:cf9f0299:e2305a7c:0d03d014

SET READAHEAD BUFFER TO 65K

[saurajeet.d@es1 ~]$ sudo blockdev --setra 65536 /dev/md0
[saurajeet.d@es1 ~]$

DEFAULT BLOCK SIZE TAKEN WAS

[saurajeet.d@es1 ~]$ cat /sys/block/md0/queue/physical_block_size 
512

CREATING FILE SYSTEM ONTO THE ARRAY

[saurajeet.d@es1 ~]$ sudo mkfs.xfs /dev/md0
log stripe unit (524288 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/md0 isize=256 agcount=16, agsize=8388480 blks
 = sectsz=512 attr=2
data = bsize=4096 blocks=134215680, imaxpct=25
 = sunit=128 swidth=512 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=65536, version=2
 = sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
You can calculate optimal options using a calculator here: http://uclibc.org/~aldot/mkfs_stride.html in case u r using ext based file systems
You can also use tune2fs to tune out the filesystem options past this point.

BUILDING RAID

[saurajeet.d@es1 ~]$ sudo cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 xvdj[5] xvdi[3] xvdh[2] xvdg[1] xvdf[0]
 536864768 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/4] [UUUU_]
 [====>................] recovery = 22.1% (29781288/134216192) finish=125.9min speed=13822K/sec
 
unused devices: <none>

YOU CAN CHECK THE HEALTH OF THE ARRAY

[saurajeet.d@es1 ~]$ sudo mdadm --detail /dev/md0
/dev/md0:
 Version : 1.2
 Creation Time : Mon Nov 5 10:19:55 2012
 Raid Level : raid5
 Array Size : 536864768 (511.99 GiB 549.75 GB)
 Used Dev Size : 134216192 (128.00 GiB 137.44 GB)
 Raid Devices : 5
 Total Devices : 5
 Persistence : Superblock is persistent
Update Time : Mon Nov 5 11:00:47 2012
 State : clean, degraded, recovering 
 Active Devices : 4
Working Devices : 5
 Failed Devices : 0
 Spare Devices : 1
Layout : left-symmetric
 Chunk Size : 512K
Rebuild Status : 30% complete
Name : 0
 UUID : e47f9d29:cf9f0299:e2305a7c:0d03d014
  
 Events : 9
Number Major Minor RaidDevice State
 0 202 80 0 active sync /dev/sdf
 1 202 96 1 active sync /dev/sdg
 2 202 112 2 active sync /dev/sdh
 3 202 128 3 active sync /dev/sdi
 5 202 144 4 spare rebuilding /dev/sdj

NOW THAT THE RAID BUILDUP IS DONE. IF NOT WAIT TILL `cat /proc/mdstat` shows out 100% rebuilt

We have a potential problem. All storage devices are booted during the kernel loading process. Sometimes errors occur which involves the md0 to rename to md127 or some number. That is because Software RAID is a kernel module which needs takes time out of the running kernel and this missing timeline to do unexpected results. We solve this problem by putting mdadm.conf to the ramfs.
ramfs is a vital peice of information for booting. Any Fuckup may render the system unbootable.
NOTICE MATCHING VMLINUZ AND INITRD VERSION NUMBERS
[saurajeet.d@es1 ~]$ cd /boot
[saurajeet.d@es1 boot]$ ls
config-3.2.21-1.32.6.amzn1.x86_64 grub initramfs-3.2.21-1.32.6.amzn1.x86_64.img System.map-3.2.21-1.32.6.amzn1.x86_64 vmlinuz-3.2.21-1.32.6.amzn1.x86_64
[saurajeet.d@es1 boot]$ lsinitrd initramfs-3.2.21-1.32.6.amzn1.x86_64 | grep mdadm.conf 
[saurajeet.d@es1 boot]
NOTICE NO FILE CALLED MDADM.CONF found. WE NEED TO INCLUDE THIS FILE USING THE DRACUT FACILITY.
[root@es1 boot]# cp initramfs-3.2.21-1.32.6.amzn1.x86_64.img initramfs-3.2.21-1.32.6.amzn1.x86_64.img.1 
[root@es1 boot]# dracut "initramfs-$(uname -r).img" $(uname -r)
E: Will not override existing initramfs (/boot/initramfs-3.2.21-1.32.6.amzn1.x86_64.img) without --force
[root@es1 boot]# dracut "initramfs-$(uname -r).img" $(uname -r) --force
E: Will not override existing initramfs (/boot/initramfs-3.2.21-1.32.6.amzn1.x86_64.img) without --force
[root@es1 boot]# ls -l initramfs-3.2.21-1.32.6.amzn1.x86_64.img
-rw-r--r-- 1 root root 5955095 Jun 25 22:51 initramfs-3.2.21-1.32.6.amzn1.x86_64.img
[root@es1 boot]# rm initramfs-3.2.21-1.32.6.amzn1.x86_64.img
rm: remove regular file `initramfs-3.2.21-1.32.6.amzn1.x86_64.img'? y
[root@es1 boot]# dracut "initramfs-$(uname -r).img" $(uname -r)
[root@es1 boot]# ls -l
total 18684
-rw-r--r-- 1 root root 60125 Jun 23 02:34 config-3.2.21-1.32.6.amzn1.x86_64
drwxr-xr-x 2 root root 4096 Sep 4 12:14 grub
-rw-r--r-- 1 root root 8963954 Nov 5 14:35 initramfs-3.2.21-1.32.6.amzn1.x86_64.img
-rw-r--r-- 1 root root 5955095 Nov 5 14:32 initramfs-3.2.21-1.32.6.amzn1.x86_64.img.1
-rw------- 1 root root 1402139 Jun 23 02:34 System.map-3.2.21-1.32.6.amzn1.x86_64
-rwxr-xr-x 1 root root 2739088 Jun 23 02:34 vmlinuz-3.2.21-1.32.6.amzn1.x86_64
[root@es1 boot]# sudo reboot^C
[root@es1 boot]# lsinitrd initramfs-3.2.21-1.32.6.amzn1.x86_64.img | grep mdadm
-rwxr-xr-x 1 root root 451344 Mar 16 2012 sbin/mdadm
-rwxr-xr-x 1 root root 106 Jan 6 2012 sbin/mdadm_auto
-rw-r--r-- 1 root root 106 Nov 5 10:23 etc/mdadm.conf
You can try
draconf mdadmconf="{yes|no}"
if the dracut execution still doesnt include mdadm.conf

REBOOT AND TEST

saurajeet@saurajeet-THX:~$ ssh 10.10.XX.XXXX
Last login: Mon Nov 5 13:42:42 2012 from XX.XX.XX.XXX
__| __|_ )
 _| ( / Amazon Linux AMI
 ___|\___|___|
  https://aws.amazon.com/amazon-linux-ami/2012.03-release-notes/
  
There are 30 security update(s) out of 167 total update(s) available
Run "sudo yum update" to apply all updates.
Amazon Linux version 2012.09 is available.
[saurajeet.d@es1 ~]$ ls /dev/md
md/ md0 
[saurajeet.d@es1 ~]$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 xvdh[2] xvdj[5] xvdf[0] xvdi[3] xvdg[1]
 536864768 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/5] [UUUUU]
 
unused devices: <none>
[saurajeet.d@es1 ~]$ sudo mdadm -D /dev/md0
/dev/md0:
 Version : 1.2
 Creation Time : Mon Nov 5 10:19:55 2012
 Raid Level : raid5
 Array Size : 536864768 (511.99 GiB 549.75 GB)
 Used Dev Size : 134216192 (128.00 GiB 137.44 GB)
 Raid Devices : 5
 Total Devices : 5
 Persistence : Superblock is persistent
Update Time : Mon Nov 5 13:03:33 2012
 State : clean 
 Active Devices : 5
Working Devices : 5
 Failed Devices : 0
 Spare Devices : 0
Layout : left-symmetric
 Chunk Size : 512K
Name : 0
 UUID : e47f9d29:cf9f0299:e2305a7c:0d03d014
  
 Events : 26
Number Major Minor RaidDevice State
 0 202 80 0 active sync /dev/sdf
 1 202 96 1 active sync /dev/sdg
 2 202 112 2 active sync /dev/sdh
 3 202 128 3 active sync /dev/sdi
 5 202 144 4 active sync /dev/sdj
[saurajeet.d@es1 ~]$

TROUBLE SHOOT

If the RAID is not builtup during the bootup time. We may try mdadm -I which is script to automatically assemble raid from configuration files. If it fails for some reason lookup mdadm -As (Assemble and Scan), which does a manual scanning for drives to get a RAID timestamp and attempts rebuilding from there.

COMPLETE THE SETUP WITH MOUNTING

[saurajeet.d@es1 ~]$ sudo cat /etc/fstab
#
LABEL=/ / ext4 defaults,noatime 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sda3 none swap sw,comment=cloudconfig 0 0
/dev/md0 /data auto defaults,noatime 0 0

MOUNT

[saurajeet.d@es1 ~]$ sudo mkdir /data
[saurajeet.d@es1 ~]$ sudo mount /dev/md0
[saurajeet.d@es1 ~]$ ls /data -l
total 0
[saurajeet.d@es1 ~]$ mount
/dev/xvda1 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/md0 on /data type xfs (rw,noatime)
[saurajeet.d@es1 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 8.0G 1.1G 6.9G 14% /
tmpfs 3.7G 0 3.7G 0% /dev/shm
/dev/md0 512G 33M 512G 1% /data
[saurajeet.d@es1 ~]$

WHY 512G

Capacity of RAID = Smin * (n - 1) => 128G * (5 -1) => 128G * 4 => 512G

FOLLOW UPS

http://www.tldp.org/HOWTO/Software-RAID-HOWTO-5.html
http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5
http://zackreed.me/articles/38-software-raid-5-in-debian-with-mdadm
https://bugzilla.redhat.com/show_bug.cgi?id=606481
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Verifying_the_Initial_RAM_Disk_Image.html
FUTURE TASKS
CANT INCUDE CODE FOR AMAZON CLOUD FORMATION. You KNOW WHY, Happy RAIDING

Monday, February 28, 2011

Autocomplete using javascript.

KEYWORDS: suggestive text, javascript, autocomplete, completing text in javascript.


Save the following code as an html file and run it in any browser

CODE



<!--AUTOCOMPLETE DEMONSTATION BY SAURAJEET DUTTA
Birla Institute Of Technology, Mesra, Ranchi
Feb 28, 2011

This code is only made to test the autocompleting procedure from one word "saurajeet"
this code has to be modified for a list of word...
-->
<script type="text/javascript">
document.onkeyup = KeyCheck;
function KeyCheck(e)
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
switch(KeyID)
{
case 13: if (document.getElementById("suggest").innerHTML == "<no suggest>")
break;
else
{ document.getElementById("typepad").value = document.getElementById("suggest").innerHTML;
return;
}
}
}

function suggest(str)
{ document.getElementById("ff").innerHTML = str.length;
var suggest = "saurajeet";
if (matched (suggest, str))
{ document.getElementById("suggest").innerHTML = suggest;
}
else
{ document.getElementById("suggest").innerHTML = "<no suggest>";
}
return;
}

function matched (a, b)
{ if (b.length < 4)
{ return false;
}
for (var i = 0; i < b.length; i++)
{ if (a[i] != b[i])
return false;
}
return true;
}

</script>
<input type="text" name="MyText" id='typepad' onkeyup="suggest(this.value)" onchange="" />
<strong id="ff">0</strong>
<strong>, Suggestive Text </strong> <label id="suggest">No Suggestion</label>
<pre>
1. Enter the string "saur" into the textbox
2. Once the suggestive Text changes Appears in
3. press enter to complete the string

Note: This code is only made with to work with one word change the program accordingly for a list of words..

HOPE I HAVE FULFILLED SOME OF YOUR EXPECTATIONS
</pre>

Monday, June 7, 2010

My hbagh. trip for DSS analysis

Hi, i am currently doing a summer project on a DSS. We are designing this for a local company. You might not expect much of my photographs as i was the one taking them.

I really enjoyed the trip. These are some of the snaps to cherish.

Ready

We in the hostel ready for taking the trip. I, Ganesh [left] and RKS[right]. At least we are the permanent members.

IMG_2545

Walking by the countryside and hoping that our ride from BIT more does not be late. We had a walk of at least 30 minutes.IMG_2549

We got the ride but very late. The chauffeur woke up late. I don't understand, these chauffeurs sleep all day in their vehicle and still needs the night for sleeping, had i been a chauffer, i would have gone to strip clubs at nights. That snoring bastard kept us waiting in that heat for 90 minutes. Any way the journey is on.

IMG_2551You now came the humpy bumpy. In the highway connecting the hbagh. and ranchi, there is a coalmine which is on fire. The fire recently emerged in the road that caused the vehicles to either take a long route or a short route from the woods. As usual we chose to see the short one. That is through the woods. though the route was somewhat bumpy but was filled with natural beauty.

IMG_2555

IMG_2558

At last, we reached the destination.

IMG_2568IMG_2567

The office of e-nibandhan, Jharkhand Automated Registration System (JARS), Department of Information Technology, Government of Jharkhand. SRO – Hazaribagh.

IMG_2563[Look at the serious people, working]

We were enquiring the employers about the operation in practice. We were killing their precious time. Most importantly we got full support from the very employers in building something that is going to make their professional life miserable in the future.

IMG_2566

Our work was over in an about 1 hr or so, we were lucky to have less crowd and our question answer session was smooth.

Mr. Manish, the divisional head [not included in the photo] was of great help along with above operators. Their experience in this matter was unmatched and the speed of executing an ORD was unexpectedly awesome with accuracy.

We had prepared a list of question to ask. All were answered in a very detailed way with example. And an ORD was processed in front of us to make sure that we get the process.

  NOW ITS THE FUN TIMEIMG_2570 IMG_2573

At last we are back at Mesra.

IMG_2576

Wednesday, February 3, 2010

Operating System Lab Practicals

2 processes ‘A’ and ‘B’ consist of an alternating sequence of CPU burst and IO burst. Each burst is of 1 second duration. There are 10 CPU burst and 9 IO burst in each job. If job ‘A’ runs first than job ‘B’, how much time does is take to run the two jobs ‘A’ and ‘B’.
  How much time will the job ‘A’ take for completion?
  How much time will job ‘B’ take for completion?
  How much time does the CPU remains idle?
  What is the percentage utilization of CPU?
  If two jobs are multi-programmed we start with job A. How much time will it take?

/* CALCULATING THE TIME TAKEN BY THE TWO PROCESSES
*     AUTHOR     : Saurajeet Dutta
*     EMAIL        : <vention.gothics> AT <gmail> DOT COM
*     DATE         : JAN 26 2010
*     INSTITUTE : Birla Institute of Technology, Mesra
*     LICENSE    : FREE (as in freedom not as in beer)
*           THE COMPILATION USES POSIX THREADING LIBRARIES.
*           DEVELOPED IN openSuSE 11.2
*/

#include <stdio.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>

//MACRO SECTION
    #define SINGLE_PROGRAMMING 0
    #define MULTI_PROGRAMMING 1
//END MACRO SECTION

//GLOBAL VARIABLE
    unsigned short cpu_timeA = 0;
    unsigned short cpu_timeB = 0;
    unsigned short io_timeA = 0;
    unsigned short io_timeB = 0;
//END GLOBAL VARIABLE

typedef struct
{    unsigned short thread_id;
    bool mode;
} thread_control_block;

void * fnA (void * tcbA)
{    thread_control_block *myTCB;
    unsigned short cpu_burst= 10;
    unsigned short io_burst = 9;
    unsigned long localCtr = 0;
    int dummy, i;
    myTCB = (thread_control_block *) tcbA; 
    if (myTCB->mode == SINGLE_PROGRAMMING)
    {    for (localCtr = 0; localCtr < cpu_burst; localCtr++)
        {         cpu_timeA++;
        }
        for (localCtr = 0; localCtr < io_burst; localCtr++)
        {         io_timeA++;
        }
    }
    if (myTCB->mode == MULTI_PROGRAMMING)
    {    //CPU burst
        for (localCtr = 0; localCtr < 800000000; localCtr++)
        {} 
        sleep(9);
    }
}

void * fnB (void * tcbB)
{    int dummy, i;
    thread_control_block * myTCB;
    unsigned short cpu_burst= 10;
    unsigned short io_burst = 9;
    unsigned long localCtr = 0;
    myTCB = (thread_control_block *) tcbB; 
    if (myTCB->mode == SINGLE_PROGRAMMING)
    {    for (localCtr = 0; localCtr < cpu_burst; localCtr++)
        {            cpu_timeB++;
        }
        for (localCtr = 0; localCtr < io_burst; localCtr++)
        {            io_timeB++;
        }
    }
    if (myTCB->mode == MULTI_PROGRAMMING)
    {        sleep (9);
        for (localCtr = 0; localCtr < 800000000; localCtr++)        //an average machine takes about 10s of cpu burst to compute this loop
        {}  
    }
}   

int main (void)
{    pthread_t threadA, threadB;
    int retCode = 0;
    int total_time = 0;
    float eff = 0;
    time_t time1, time2;

    //create thread control block
    thread_control_block tcb1;
    thread_control_block tcb2;
    tcb1.thread_id = 1;
    tcb1.mode = SINGLE_PROGRAMMING;
    tcb2.thread_id = 2;
    tcb2.mode = SINGLE_PROGRAMMING;

    //entering single programming mode
    fnA ((void *) &tcb1);
    fnB ((void *) &tcb2);

    //analysing results
    total_time = cpu_timeA + io_timeA;
    printf ("\n\n\tSINGLE PROGRAMMING\n\tThe total time taken by process A is %d\n", total_time);
    printf ("\tCPU time for A is %d\n", cpu_timeA);
    printf ("\tIO time for A is %d\n", io_timeA);
    printf ("\tCPU idle time for A is %d\n\n", total_time - cpu_timeA);
    total_time = cpu_timeB + io_timeB;
    printf ("\tThe total time taken by process B is %d\n",total_time);
    printf ("\tCPU time for B is %d\n", cpu_timeB);
    printf ("\tIO time for B is %d\n", io_timeB);
    printf ("\tCPU idle time for B is %d\n", total_time - cpu_timeB);
    eff = cpu_timeA + cpu_timeB;
    eff /= cpu_timeA + cpu_timeB + io_timeA  + io_timeB;
    eff *= 100;
    printf ("\n CPU EFFICIENCY [SINGLE PROGRAMMING] : %f\n", eff);
    //creating thread a;
    tcb1.mode = MULTI_PROGRAMMING;
    tcb2.mode = MULTI_PROGRAMMING;
    time (&time1);
    retCode = pthread_create (&threadA, NULL, fnA, (void *)&tcb1);
    if (retCode < 0)
    {    printf ("Error in creating the thread.\n");
        pthread_exit(NULL);
        return EXIT_FAILURE;
    }

    //creating thread b
    retCode = pthread_create (&threadB, NULL, fnB, (void *)&tcb2);
    if (retCode < 0)
    {    printf ("Error in creating thread B.\n");
        pthread_exit(NULL);
        return EXIT_FAILURE;
    }

    pthread_join (threadB, NULL);
    time(&time2);
    printf ("The total time taken for execution of 2 threads is: %d", time2 - time1);
    eff = 20;
    eff /= (time2 - time1 + 1);
    eff *= 100;
    printf ("\n\n\t CPU EFFICIENCY [MULTITASKING]: %f\n", eff);
    return EXIT_SUCCESS;
}

Wednesday, January 13, 2010

About Me

Hi i am Saurajeet Dutta,

I am a student at Birla Institute of Technology, Mesra
I am a keen learner and a programming enthusiast,

I mainly code on linux.

Currently i am persuing my Masters at the same institute.

I got my First Job in Directi Internet Solutions Private Limited.
And i m working there since 4th Jan 2012.