Stage di Informatica
-
Upload
chase-harrison -
Category
Documents
-
view
25 -
download
0
description
Transcript of Stage di Informatica
Stage di InformaticaStage di Informatica
Studenti: Karen Jomayra Montes Rua
Gabriele Scolastri
Tutor: Giuseppe Fabio Fortugno
Stage di InformaticaStage di Informatica
•Introduzione sistema operativo Unix (nascita, sviluppo, utilizzo)…•Funzionamento dei file system, compact disc, disco rigido.•Il sistema operativo, fase di bootstrap, ram...•Network, LAN, connessione ethernet (fase analogica e digitale), protocolli tcp/ip…•Linguaggio C, programmazione…•Misura della velocita’ di NFS v3…
Linguaggio CLinguaggio C
E’ un linguaggio di programmazione di medio livello. Ciò significa che il linguaggio C è articolato e potente quasi come il linguaggio della macchina (assembler), ma meno complesso.
Può essere scritto con programmi di scrittura come vi, Emacs e Pico, per poi essere compilato da Unix attraverso il compilatore.
La sua potenza permette sia di modificare parti del sistema operativo che di crearne uno ex novo!!
Test di Velocita’ di NFSTest di Velocita’ di NFS
L’obbiettivo è calcolare la velocità con cui uno o più client riescono a lavorare in contemporanea su un server & quale sia il blocksize (pacchetto di dati) migliore per ottenere maggiori velocità.
• 5 blocksize: 512, 1024, 2048, 4096, 8192 byte• max 4 Client• Tipo connessione: NFS su TCP/IP
Elenco componenti usati nel test di velocita’
Elenco componenti usati nel test di velocita’
HARDWARE:
1 Switch Cisco 4500 con porte Gigabit Ethernet
1 IBM xSeries 340Processore Intel Xeon a 2 GHz1024 Mbyte RamDue dischi SCSI FW da 36 GbyteGigabit Ethernet Card in fibra ottica
4 IBM xSeries 330Processore Intel Xeon 2 Ghz512 Mbyte RAMUn disco SCSI da 9 GbyteGigabit Ethernet Card in rame
HARDWARE:
1 Switch Cisco 4500 con porte Gigabit Ethernet
1 IBM xSeries 340Processore Intel Xeon a 2 GHz1024 Mbyte RamDue dischi SCSI FW da 36 GbyteGigabit Ethernet Card in fibra ottica
4 IBM xSeries 330Processore Intel Xeon 2 Ghz512 Mbyte RAMUn disco SCSI da 9 GbyteGigabit Ethernet Card in rame
SOFTWARE:
ServerLinux Suse Enterprise Server 9.2
Kernel ver. 2.6.5NFS Server V3
ClientLinux Suse Enterprise Server 9.2
Kernel ver. 2.6.5NFS Client V3Gnu C Compiler ver.3.3.3
SOFTWARE:
ServerLinux Suse Enterprise Server 9.2
Kernel ver. 2.6.5NFS Server V3
ClientLinux Suse Enterprise Server 9.2
Kernel ver. 2.6.5NFS Client V3Gnu C Compiler ver.3.3.3
Gigabit-Ethernet
SCSI Fast Wide 160MB/s
lxmaster01
lxmaster02
lxmaster03 lxmaster04
lxmaster05
Switch Cisco 4500
NFS server
Struttura del cluster linux su cui sono state fatte le prove di scrittura e lettura
Struttura del cluster linux su cui sono state fatte le prove di scrittura e lettura
Gigabit-Ethernet
SCSI Fast Wide 160MB/s
lxmaster01
lxmaster02
lxmaster03 lxmaster04
lxmaster05
NFS server
NFS Client
NFS Client NFS Client
NFS Client
/work/
work
stage
cl01 cl02 cl03 cl04
Struttura logica del cluster Struttura logica del cluster
Programma C di scrittura k=atoi(argv[1]); switch(k) { case 1: n=512; break; case 2: n=1024; break; case 3: n=2048; break; case 4: n=4096; break; case 5: n=8192; break; default: n=512; }
do{ v[i]=random(); i++; }while(i<n); fd=creat("misura", S_IRUSR|S_IWUSR|S_IRGRP); pn=&v[0]; printf("\n Inizio scrittura del file \n"); t1=time(NULL); for(k=0; k<(m/n); k++){ rc=write(fd, pn, n); }
t2=time(NULL); t=difftime(t2,t1);
printf("\n Fine scrittura del file \n"); printf("\n Il tempo che il computer ha “); printf(“ impiegato per scrivere il file e` %7.3f s\n",t); close(fd);}
#include<stdio.h>#include<stdlib.h>#include<fcntl.h>#include<sys/types.h>#include<sys/stat.h>#include<time.h>#include<bits/time.h>
main(int argc,char *argv[]){ int n, v[8192], i, k, m=512000000, rc=0; time_t t1,t2,t3; double t; int fd; int *pn; i=0;
if(argc==1) { printf("\n Inserisci una delle seguenti opzioni: \n"); printf("\n 1 -> 512 Byte Block "); printf("\n 2 -> 1024 Byte Block "); printf("\n 3 -> 2048 Byte Block "); printf("\n 4 -> 4096 Byte Block "); printf("\n 5 -> 8192 Byte Block \n\n "); exit(1); }
fd=creat(fn,type)
Programma C di lettura k=atoi(argv[1]); switch(k) { case 1: n=512; break; case 2: n=1024; break; case 3: n=2048; break; case 4: n=4096; break; case 5: n=8192; break; default: n=512; }
do{ v[i]=random(); i++; }while(i<n); fd=open("misura", O_RDONLY); pn=&v[0]; printf("\n Inizio lettura del file \n"); t1=time(NULL); for(k=0; k<(m/n); k++){ rc=read(fd, pn, n); }
t2=time(NULL); t=difftime(t2,t1);
printf("\n Fine lettura del file \n"); printf("\n Il tempo che il computer ha “); printf(“ impiegato per leggere il file e` %7.3f s\n",t); close(fd);}
#include<stdio.h>#include<stdlib.h>#include<fcntl.h>#include<sys/types.h>#include<sys/stat.h>#include<time.h>#include<bits/time.h>
main(int argc,char *argv[]){ int n, v[8192], i, k, m=512000000, rc=0; time_t t1,t2,t3; double t; int fd; int *pn; i=0;
if(argc==1) { printf("\n Inserisci una delle seguenti opzioni: \n"); printf("\n 1 -> 512 Byte Block "); printf("\n 2 -> 1024 Byte Block "); printf("\n 3 -> 2048 Byte Block "); printf("\n 4 -> 4096 Byte Block "); printf("\n 5 -> 8192 Byte Block \n\n "); exit(1); }
fd=open(fn,type)
Misure effettuate sul cluster linux
Scrittura
Lettura
Blocksize
(Byte)
Velocita’ con 1 client (Mbyte/s)
Velocita’ con 2 client (Mbyte/s)
Velocita’ con 3 client (Mbyte/s)
Velocita’ con 4 client (Mbyte/s)
512 13,84 5,38 4,10 5,20
1024 13,80 8,25 5,41 5,30
2048 12,80 7,10 4,10 3,60
4096 9,25 3,90 3,60 3,60
8192 8,80 3,70 3,56 3,40
Blocksize
(Byte)
Velocita’ con 1 client (Mbyte/s)
Velocita’ con 2 client (Mbyte/s)
Velocita’ con 3 client (Mbyte/s)
Velocita’ con 4 client (Mbyte/s)
512 9,07 4,91 3,26 2,58
1024 10,01 5,63 3,85 2,93
2048 9,61 5,69 3,76 2,92
4096 9,65 5,62 3,76 3,12
8192 9,54 5,61 3,77 2,90
512 1024 20484096 8192
Client = 4
Client = 3Clinet = 2
Client = 1
0,00
2,00
4,00
6,00
8,00
10,00
12,00
14,00
Sp
ee
d (
Mb
yte
/s)
Blocksize (bytes)
NFS V3 Client Speed
5121024
20484096
8192
Client = 1
Clinet = 2
Client = 3
Client = 4
0
5
10
15
20
25T
hro
ug
hp
ut
(Mb
yte
/s)
Blocksize (Bytes)
NFS V3 Server Throughput
Dal punto di vista delClient questo e’ il valoremigliore da impostare in scrittura
Dal punto di vista delServer questo e’ il valore che massimizza le scritture
512 1024 2048 4096 8192
Client = 4Client = 3
Clinet = 2Client = 1
0,00
2,00
4,00
6,00
8,00
10,00
12,00
Sp
ee
d (
MB
yte
s/s
)
Blocksize (Byte)
NFS V3 Client Speed
512 10242048
40968192
Client = 1
Clinet = 2Client = 3
Client = 4
0
2
4
6
8
10
12
14
Th
rou
gh
pu
t (M
By
te/s
)
Blocksize (Bytes)
NFS V3 Server Throughput
Dal punto di vista delClient questo e’ il valoremigliore da impostare in lettura
Dal punto di vista delServer questo e’ il valore che massimizza le letture
0,00
20,00
40,00
60,00
80,00
100,00
120,00S
pee
d (
MB
yte/
s)
512 1024 2048 4096 8192
Blocksize (byte)
SCSI vs NFS
NFS Client
SCSI locale
Blocksize del filesystem
Conclusioni:
I. Se un filesystem NFS esporta dati in lettura/scrittura tra piu’ di un client sara’ meglio usare un blcksize pari a 1024
II. Se invece il filesystem servira’ per dati readonly avremo il massimo throughput con un blocksize pari a 4096 Byte.
Tcp/ip buffer
Server NFS
NFS task
NFS task
NFS task
NFS task
S.O. buffers
SCSI Buffer
Avendo piu’ tempo…
Client NFS
Client NFS
Client NFS
Client NFS
Server NFS
Tcp/ip buffer
Tcp/ip buffer
Tcp/ip buffer
Tcp/ip buffer
Tcp/ip buffer
e…
client server
Stage di InformaticaStage di Informatica
Grazie per l’attenzione!