trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Support splice in http blind tunnel

Open YIHONG-JIN opened this issue 1 year ago • 10 comments

  1. Add TS_USE_LINUX_SPLICE as a compilation option.
  2. Make MIOBuffer and MIOBufferReader polymorphic classes making their member function virtual.
  3. Create PipeIOBuffer and PipeIOBufferReader as derived classes, encapsulating Linux pipe.
  4. Use dynamic_cast to enable logic switch in state machines and continuations.

Documentations: ATS_splice_runbook.md ATS Performance Benchmark.pdf ATS_splice_design_doc.pdf

YIHONG-JIN avatar Dec 04 '24 08:12 YIHONG-JIN

Passes unit test and manual integration test on Debian 12. Performance benchmark shows that splice could improve maximum blind tunnel throughput from 300 MB/s to 575 MB/s and reduce latency by 40% for MB level payload on C6in.large EC2 instance. Feel free to benchmark this CR.

YIHONG-JIN avatar Dec 04 '24 22:12 YIHONG-JIN

Thanks for the comments @moonchen. I will start to resolve the comments

YIHONG-JIN avatar Jan 22 '25 23:01 YIHONG-JIN

Slightly reorganized the file structure to decouple PipieIOBuffer from original IOBuffer.

YIHONG-JIN avatar Jan 27 '25 07:01 YIHONG-JIN

The latest revision is to address the following comments:

  1. https://github.com/apache/trafficserver/pull/11890#discussion_r1925531050
  2. https://github.com/apache/trafficserver/pull/11890#discussion_r1925533339

YIHONG-JIN avatar Jan 31 '25 04:01 YIHONG-JIN

[approve ci]

moonchen avatar Mar 11 '25 14:03 moonchen

@YIHONG-JIN can you take a look at the CI failures? Looks like clang-format and license header checks found some problems.

moonchen avatar Mar 11 '25 20:03 moonchen

Thanks! Will take a look at CI failures this weekend. @moonchen

YIHONG-JIN avatar Mar 13 '25 19:03 YIHONG-JIN

[approve ci]

bryancall avatar Mar 17 '25 22:03 bryancall

Took a look. Looks like format is fine this time. @bryancall Is there a way to read the log of failed tests or reproduce them locally? Looks like I don't have permissions to read the logs

YIHONG-JIN avatar Mar 21 '25 17:03 YIHONG-JIN

[approve ci]

bryancall avatar May 05 '25 22:05 bryancall

[approve ci]

bryancall avatar Jun 23 '25 22:06 bryancall

@YIHONG-JIN sorry for the late response, we went through all the open PRs yesterday in our meeting.

You can go to the URLs below and look at the console output. For example here is the run for Ubuntu: https://ci.trafficserver.apache.org/job/Github_Builds/job/ubuntu/6069/ And here is the Ubuntu build output: https://ci.trafficserver.apache.org/job/Github_Builds/job/ubuntu/6069/console

And I am seeing the errors:

/usr/bin/ccache /usr/lib/llvm-12/bin/clang++ -DDEBUG -DPACKAGE_NAME="\"Apache Traffic Server\"" -DPACKAGE_VERSION=\"10.2.0\" -D_DEBUG -Dlinux -I/home/jenkins/workspace/Github_Builds/ubuntu/src/include -I/home/jenkins/workspace/Github_Builds/ubuntu/src/build/include -I/home/jenkins/workspace/Github_Builds/ubuntu/src/lib/swoc/include -I/home/jenkins/workspace/Github_Builds/ubuntu/src/lib/yamlcpp/include -isystem /home/jenkins/workspace/Github_Builds/ubuntu/src/lib/systemtap -D_FORTIFY_SOURCE=2 -fPIE -fstack-protector -pthread -g -std=c++20 -Wno-invalid-offsetof -pipe -Wall -Wextra -Wno-noexcept-type -Wsuggest-override -Wno-vla-extension -fno-strict-aliasing -Wno-deprecated-declarations -mcx16 -Werror -MD -MT src/iocore/net/CMakeFiles/inknet.dir/UnixNetVConnection.cc.o -MF src/iocore/net/CMakeFiles/inknet.dir/UnixNetVConnection.cc.o.d -o src/iocore/net/CMakeFiles/inknet.dir/UnixNetVConnection.cc.o -c /home/jenkins/workspace/Github_Builds/ubuntu/src/src/iocore/net/UnixNetVConnection.cc
../src/iocore/net/UnixNetVConnection.cc:643:3: error: unknown type name 'PipeIOBuffer'
  PipeIOBuffer *pipe_buffer = dynamic_cast<PipeIOBuffer *>(buf.writer());
  ^
../src/iocore/net/UnixNetVConnection.cc:643:44: error: unknown type name 'PipeIOBuffer'
  PipeIOBuffer *pipe_buffer = dynamic_cast<PipeIOBuffer *>(buf.writer());
                                           ^
../src/iocore/net/UnixNetVConnection.cc:649:20: error: no member named 'splice_to' in 'UnixSocket'
      r = con.sock.splice_to(pipe_buffer->fd[1], to_splice, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
          ~~~~~~~~ ^
3 errors generated.

bryancall avatar Jun 24 '25 17:06 bryancall

This pull request has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.

github-actions[bot] avatar Sep 23 '25 02:09 github-actions[bot]