Help - Search - Members - Calendar
Full Version: best way to mount Hd between servers in a rack..
The Planet Forums > System Administration > Server Hardware > Private Racks
francescoo
hi, ok maybe ftp is the fastest way to transfer data between 2 different pc on a rack... but i need something little complicated..
read/write a small portion of a file placed on a ramdisk on server1 using a script from server2 ... 80 times/second...

so mounting i think that it's the only one way.. i've googled a lot about nfs and samba..
someone tell that samba is fastest.. someonelese tell that nfs is fastest...

for this purpose what do you gurus suggest to me? :eek:

please,i'm waiting you!!

Thanks,
Francesco
eth00
So you need the file to read the same even though it is being updated 80 times a second? That is an interesting situation and I don't know if either is THAT fast. I can tell you from experience NFS works really good and I have talked with some people from yahoo in the past and they still use NFS for some of their stuff so it must not be that bad icon_smile.gif

Are both going to be updating or is only one of the two servers going to be updating the file?
francescoo
the things are little more complicated of what i've described.. because server are 3 for the moment.. and i don't want to use all the resources just to read a file..

i cannot do the read from tcp ip->(http) because i have to read a portion of the file.. for example.. from byte 809030 to byte 813000 ... and yes.. the client have to write a file on the server, about 1 mb file every 6 seconds and another 10 mb file every minute....

yeah strange situation :eek:

Thanks for your help guys! icon_smile.gif
francescoo
now i'm trying to do some tests with samba.. i'll post the results...

i'm not a linux expert and samba seems to be easyer to configure than nfs...
anyway i've also found this http://www.dest-unreach.org/socat/doc/soca...tml#DESCRIPTION
but for my linux knoledgment is too much icon_smile.gif
i don't have too much time to spend in this thing.. icon_sad.gif


Francesco Vigotti
eth00
NFS is *very* easy

On the server:

1) install portmap and nfs-utils
2) edit /etc/exports in the following form:

/share ip.to.share.to(rw,sync)

3) run exportfs -ra

On client
1) create mount directory
2) add the following in fstab:

ip.to.server:/mount /local/directory nfs rw 0 0

3) mount /local/directory


Thats it! I don't know on the performance but there is how to setup nfs if you want to try icon_smile.gif
francescoo
i've read around that nfs is very unsecure.. because portmap and nfs is a complex system which like all complex system leave the way open to bugs... icon_sad.gif do you have had any security problems with nfs?
eth00
If you are on a private rack you can run it on a secondary network. If you only have 1 network firewall off the port and only allow access to it from server > server. Even if you run a vulnerable version, which it *should* be ok as of now, with a firewall blocking remote connections you are safe if no untrusted users do not have accounts.
francescoo
i'm not good to manage firewall and i have just a portion of the rack.. icon_sad.gif

anyway i've done some tests with samba..
server: celeron 2.6 ghz with normal hd..
client: dual xeon 3.2

used php to write file from the xeon to the server(celeron)
for ($i=0;$i<$ciclo;$i++){
//$file = './../test/'.$i.'.dat';
$file = './smbtest/'.$i.'.dat';
$handle = fopen ($file, 'w'); // Let's open for read and write
fwrite ($handle, $test_string); // Don't forget to increment the counter
fclose ($handle); // Done
}




these are the results..
1 line output
DONE IN 753.31152 seconds writing 20000 different files ;
60%cpu, 5% io -> DONE IN 8.88320 seconds writing 2000 different files
DONE IN 4.08079 seconds writing 500 different files
DONE IN 0.27418 seconds writing 50 different files
DONE IN 0.05402 seconds writing 10 different files

1000 lines output
DONE IN 0.16756 seconds writing 10 different files with a string of 1000 lines
DONE IN 0.89410 seconds writing 50 different files with a string of 1000 lines
DONE IN 7.39047 seconds writing 500 different files with a string of 1000 lines


10k lines output
DONE IN 0.16756 seconds writing 10 different files with a string of 10000 lines (580 kb file)
15%cpu + 35%io ->DONE IN 49.42771 seconds writing 500 different files with a string of 10000 lines (580 kb file)
DONE IN 5.17738 seconds writing 50 different files with a string of 10000 lines
DONE IN 0.49385 seconds writing 5 different files with a string of 10000 lines

100k lines output
15%cpu + 20%io -> DONE IN 50.37175 seconds writing 50 different files with a string of 100000 lines (5.8 MB file)
DONE IN 0.16756 seconds writing 10 different files with a string of 100000 lines (5.8 MB file)


not too bad.. can write 50 files in 0.27418, and with an average write speed of 5.4mb/sec writing big files..

i've done some tests reading a file, from a random position, reading 1000 lines on a 2 gb logfile take 0.1 seconds, with an average cpu usage of 15% on the server.. 1%client, 0%io usage on both
reading 10.000 lines take 0.8 seconds... so not bad results icon_smile.gif
i'll try to adapt my app now to work with samba... we will see icon_smile.gif


Thanks!
Francesco
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.