Fastest way to write huge files

M

Mohamed Yousef

Hello ,

let's say , I'm moving large files through network between devices
what is the fastest way to do this ?
what i came up with :-

1) using regular file operations with an in memory limit of 4MB which
when filled written to disk and re-filled again

2) using memory mapped files in the following way , map first 20MB of
file and after finishing them flush and map next 20MB
------
which of them should be faster in writting to disk ? and less memory consuming

or is there faster ways ?

Thanks,

Regards ,
Mohamed Yousef
 
S

saswat

Hello ,

let's say , I'm moving large files through network between devices
what is the fastest way to do this ?
what i came up with :-

1) using regular file operations with an in memory limit of 4MB which
when filled written to disk and re-filled again

2) using memory mapped files in the following way , map first 20MB of
file and after finishing them flush and map next 20MB
------
which of them should be faster in writting to disk ? and less memory consuming

or is there faster ways ?

Thanks,

Regards ,
Mohamed Yousef

In the send side :

You may want to use sendfile and here is python package for same
http://pypi.python.org/pypi/py-sendfile/1.2.3

In the receive side :

You may want to use splice (Linux 2.6.17 onwards) - Just read from a
network fd and write to a file fd

I just assumed you are using Linux.:)

Thanks
-Saswat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top