My initial thought is that most of the time is being spent issuing smallish reads. Indeed, Andreas' last post showed this is the case.

Most copy programs do not use an event model because it really is a CPU eater. There is no need because it's a dedicated process doing a single task (i.e. copying). Copy programs just do blocking reads or, if there is no external timeout mechanism, pollwait reads.

That said, in the xroot case, you are always told how much data will be coming and guaranteed that the socket will close if that amount was not sent. So, the least amount of CPU you can spend here is to issue a recv() for the specified number of bytes and set the MSG_WAITALL flag. Guaranteed that this is the best you will be able to do (based on practical experience). Using splice won't even come close to making up the difference. So, I wouldn't bother.

Of course, the maximum window size needs to be set correctly on the machine so that auto-tuning has something to work with. I've seen good results with the r/wmem figure set to "524288 419430 16777216" (RH5 with 24GB RAM).


Reply to this email directly or view it on GitHub.



Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1