lazy saunter

(personal learnings in computation)

Friday, October 19, 2007

SSH vs. XML-PRC

once i got the two machines communicating with each other (once i had placed the public key for the web server on the remote machine that is doing the processing), i began banging away and converting the project done last october from using the php XML-RPC package to use SSH instead. once i saw how the local shell script would call the remote program and wait for that program's exit code to be returned (and which would then be used to display success/failure status), i was convinced that SSH could do everything that i was having XML-RPC do.

keeping it how it is (using XML-RPC) takes about 2 seconds from the time you submit the web form til you get your response with success/failure message. the same project using SSH instead takes about 20 seconds from submit to response.

i think i would be an idiot to change things over to SSH (or be breaking some basic programming laws- "if it aint broke and it aint slow, dont fix it to run slower" perhaps) but i think i m gonna do it anyway.

why? to move complex code to simpler code. XML-PRC uses 2 local files and 3 remote files. SSH will use 3 local files (the extra file is the shell script) and only 1 remote file. the remote machine is soon going to be taken offline so i need to be able to move my remote files to another server quite easily. moving one file is easy.

a second reason is that the new approach uses simpler php programming and a shell script to handle the remote program call. this will be much simpler for other people (me included) to maintain in the future.

if it werent for the slowness of using SSH (which i guess is due to the encryption/decryption and authentication), this solution would be perfect.

1 Comments:

  • At 1:34 AM , Blogger POPPA said...

    H, I'm constantly amazed!! These & last 3 posts were most interesting. Good to hear from you again after so long.

     

Post a Comment

Subscribe to Post Comments [Atom]

<< Home