0

I am wondering, if the speed of copy processes between user and kernel space, and in general within the whole tcp send/receive process, is dependent on the type of file (.txt, .mp4). I mean not the file size, but the "structure" of the bytes or anything. I searched for quite a while but did not find anything related. Are there helpful phrases or terms I could have a look for ?

Thanks in advance!

1 Answers1

0

TCP has no idea of the application level structure of a file and thus cannot make any decisions based on this. All what it cares about is a byte stream.

But it is not uncommon that how the application interacts with the kernel depends on the specific protocol and that this can have noticeable effects on the performance: for example one application might just write 1000 bytes at once to the kernel while another writes a 500 byte HTTP header followed by a 500 byte HTTP body. These might in both cases be the exact same bytes but more context switches are involved in the second case due to more syscalls and depending on the socket options this might also result in two TCP packets instead of one, where each TCP packet has a noticeable overhead in bytes and in processing time.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172