What are the principles for selecting sendfile and mmap?

sendfile and mmap are both typical zero-copy technologies, and sendfile is very efficient when files do not need to be modified. It is said that mmap is more suitable for the transfer of small files, while sendfile is more suitable for large files. How should I understand this? Is this statement correct? If yes, what is the cause?


I think the platform is obsolete, and it would be nice to have a satisfactory answer to the question. The rest do not even have an answer


large files reduce data replication in user mode and kernel state through sendfile, the amount of copying of small files is small, the replication overhead is less than sendfile, and mmap does not know much about it

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30457-4028b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30457-4028b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?