Webservice vs FTP service
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Webservice vs FTP service
I am building a service in which I need to tranfer a binary file from one server to the next and back when finished.
My questions is...which is more effective/ faster/ effcient to use?
1) use xml-rpc to encode and pass the file binary data to the server
2) use php ftp to transfer the file...
3) use the file_get_contents() to get the file
My questions is...which is more effective/ faster/ effcient to use?
1) use xml-rpc to encode and pass the file binary data to the server
2) use php ftp to transfer the file...
3) use the file_get_contents() to get the file
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Webservice vs FTP service
A download will typically be several times faster an than upload, so the file_get_contents() would be the fastest.
I would probably use the FTP functions since is probably the most flexible method out of the box.
I would probably use the FTP functions since is probably the most flexible method out of the box.
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Webservice vs FTP service
thanks for the tip
Re: Webservice vs FTP service
rsync, more secure ( operates over ssh ) more efficient.. or scp, sftp, etc..
John I'm curious why you say a download will be faster? Won't the server still be doing uploading no matter what method is used? I thought it took 2 to tango, a client and a server
John I'm curious why you say a download will be faster? Won't the server still be doing uploading no matter what method is used? I thought it took 2 to tango, a client and a server
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Webservice vs FTP service
ok whats rsync? I was hoping not to implement any more libraries...just installed that pecl upload progress extension...So i'm going to try that.josh wrote:rsync, more secure ( operates over ssh ) more efficient.. or scp, sftp, etc..
I am also curious...what are you trying to say...whose faster? ftp, file_get_contents or xml-rpc?josh wrote:John I'm curious why you say a download will be faster? Won't the server still be doing uploading no matter what method is used? I thought it took 2 to tango, a client and a server
Re: Webservice vs FTP service
http://www.samba.org/rsync/
Under a few large files being transferred protocol will play little to no effect. It is when you are moving 999999 small files ( like a web crawler ) the minor differences in libraries will play a larger role.
At your linux command line type 'man rsync', most systems already have it, its as common a command for some as 'cp' or 'mv', scp is the same kinda deal ( a utility /command for network copying over ssh that all linux machines have now adays ). Rsync has the advantage of really good efficiency in terms of copying only differences. ( SCP would copy a whole folder even if nothing changed, rsync would copy just 1 byte if thats all you changed in a 100MB file )
http://www.samba.org/rsync/features.html
Under a few large files being transferred protocol will play little to no effect. It is when you are moving 999999 small files ( like a web crawler ) the minor differences in libraries will play a larger role.
At your linux command line type 'man rsync', most systems already have it, its as common a command for some as 'cp' or 'mv', scp is the same kinda deal ( a utility /command for network copying over ssh that all linux machines have now adays ). Rsync has the advantage of really good efficiency in terms of copying only differences. ( SCP would copy a whole folder even if nothing changed, rsync would copy just 1 byte if thats all you changed in a 100MB file )
http://www.samba.org/rsync/features.html
Re: Webservice vs FTP service
file_get_contents() will use memory mapping techniques
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: Webservice vs FTP service
"file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance. "scottayy wrote:file_get_contents() will use memory mapping techniques
I would read that line with a grain of salt just because loading an entire file into memory isn't always the "preferred" way to read a file, like if the file is larger then available memory on the system. It's probably true for "average" file reading situations, but without more details as to # of files, size, transfer frequency, available bandwidth, etc.. etc... its hard to recommend a single "Best" option
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Webservice vs FTP service
I went ahead and installed the uploagprogress PECL extension. I have decided to go with $_POST...and then probably FTP the file back...Did not like the fact that I had to transfer the file 3 times...What are your thoughts on using $_POST for this sort of thing?
Re: Webservice vs FTP service
Uh it'll work just not as portable ( max filesizes, and other configuration changes ), not as reliable as something with resume