0

This could be a few questions, but I feel it's a similar issue. On which computer are mounted executable files executed? And does this change with like sshfs, nfs, or ln? Like if you have a storage server and a compute server, can executable packages on the storage server be run on the compute server?

1 Answer 1

2

For all the protocols you mention, the file is downloaded to the client system (often to temp storage), and then executed locally. The protocols do not expose remote compute, only storage.

Note that while SSHFS will execute the file locally, using SSH as a shell to run a program would cause the executables to run on the remote system. SSH exposes remote compute. SFTP/SCP only expose storage.

Mounting a remote volume doesn't really change anything about how the contents of that volume are accessed. Mounting just changes the way that the volume can be addressed (the path expression). Just like with a internal hard disk, if a program needs to read/write a file from the volume, it must first be read into RAM, and as far as the CPU is concerned, there is not really any difference amongst the different types of secondary storage, be they local or remote.

7
  • Are you talking of only the executable files? If the compute server doesn't have the space of the storage server, and data files are mounted, it sounds odd all the data files would be downloaded.
    – user1829527
    Commented Aug 8, 2023 at 17:28
  • 2
    how else do you expect them to be executed on the local CPU if the program instructions are not accessible to the local system? temp storage may just be RAM, and for many formats the data can just be streamed through and discarded immediately, but that's still downloading. Commented Aug 8, 2023 at 17:30
  • 2
    and no I don't just mean executables. the same thing happens with video. if you played video off an SMB share you have mounted, the data is downloaded to some form of buffer for rendering. the whole file need not be downloaded all at once, and the player application will be responsible for the buffering, but everything you access via network share is being sent over the network, sometimes all at once, and sometimes via a buffered stream. Commented Aug 8, 2023 at 17:33
  • 1
    That is a question that is likely subject to very subtle circumstances. a process is a memory structure so there will be a minimum amount of binary that is required to spawn the process, and I believe the executable format will impact the ability to execute it remotely without caching the entire binary locally. Commented Aug 8, 2023 at 17:52
  • 1
    Python is an interpreted language so its code is generally text content (or precompiled intermediary code). the local python runtime is the executable not the python packages. yes you are correct, but that is an entirely different question than what you asked. Commented Aug 8, 2023 at 17:54

You must log in to answer this question.