You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/17 08:20:51 UTC
[GitHub] [pulsar] coderzc opened a new issue, #15631: PIP-168 Support zero-copy of NIC to NIC on Proxy
coderzc opened a new issue, #15631:
URL: https://github.com/apache/pulsar/issues/15631
## Motivation
Currently, when the `Proxy` server transfer data will have four triggered the user mode and kernel mode of context switching, respectively is the read() / write() call and return when cut, it is inefficient for the `Proxy`.
There is an efficient way of reducing the number of copies of data and , use [`splice`](https://man7.org/linux/man-pages/man2/splice.2.html) system call for linux system.
Data transfer process diagram of `splice`:
<img width="619" alt="image" src="https://user-images.githubusercontent.com/26179648/168755276-76a6d222-7643-4f8c-80ef-1c7077dfe1ef.png">
More details about the proxy protocol see:
* [man splice](https://man7.org/linux/man-pages/man2/splice.2.html)
* [design_and_implementation_of_zero_copy_data_path_for_efficient](https://static.aminer.org/pdf/PDF/000/253/158/design_and_implementation_of_zero_copy_data_path_for_efficient.pdf)
* [Two new system calls: splice() and sync_file_range()](https://lwn.net/Articles/178199/)
## Goal
Support zero-copy of NIC to NIC on Proxy, we can get some benefits:
* Reduce the CPU load
* Improve the network throughput
* Reduce the delay
## Implementation
* Use [`splice`](https://man7.org/linux/man-pages/man2/splice.2.html) system call instead of read() / write() for linux system.
* It should only work as `proxyLogLevel == 0`
* For `HAProxy`, it should be transformed to transform `HAProxyMessageDecoder` to compatible with this optimization
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
lhotari commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132772116
> I want remove the `SslHandler` after completed handshake, I still try it.
I don't think that it could work without implementing SNI proxying.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
coderzc commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1141803825
@lhotari @merlimat @cbornet @nodece I have sent a vote email, could you take a look.
https://lists.apache.org/thread/2ycpoltmh7z76nj62bz35q5o64x7by1w
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc closed issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
coderzc closed issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
URL: https://github.com/apache/pulsar/issues/15631
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] rdhabalia commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
rdhabalia commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1166910434
@coderzc why can't we use SNI routing and use enterprise solution
https://github.com/apache/pulsar/wiki/PIP-60%3A-Support-Proxy-server-with-SNI-routing
eg: ATS, HAProxy? why are we adding unnecessary component and complex module in pulsar git repo?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
lhotari commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132715037
@coderzc Are you thinking of covering TLS too? Is it technically even possible in that case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
coderzc commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132738435
> [improve][proxy] Support zero-copy of NIC to NIC on Proxy #15678
yes, I will use [Netty's splice support](https://netty.io/news/2015/05/07/4-0-28-Final.html#:~:text=This%20release%20includes%20support%20for%20splice%20when%20using%20the%20native%20epoll%20transport.%20Splicing%20allows%20to%20directly%20transfer%20bytes%20from%20one%20filedescriptor%20to%20another%20without%20copy%20data%20from%20kernel%20to%20user%2Dspace.%20This%20makes%20splice%20a%20perfect%20fit%20i.e%20when%20you%20want%20to%20write%20a%20TCP%20proxy.)
I want remove the `SslHandler` after completed handshake, I still try again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
coderzc commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132952010
> > I want remove the `SslHandler` after completed handshake, I still try it.
>
> I don't think that it could work without implementing SNI proxying.
That's indeed so.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
lhotari commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132725586
> Use [splice](https://man7.org/linux/man-pages/man2/splice.2.html) system call instead of read() / write() for linux system.
@coderzc I suppose you mean to use [Netty's splice support](https://netty.io/news/2015/05/07/4-0-28-Final.html#:~:text=This%20release%20includes%20support%20for%20splice%20when%20using%20the%20native%20epoll%20transport.%20Splicing%20allows%20to%20directly%20transfer%20bytes%20from%20one%20filedescriptor%20to%20another%20without%20copy%20data%20from%20kernel%20to%20user%2Dspace.%20This%20makes%20splice%20a%20perfect%20fit%20i.e%20when%20you%20want%20to%20write%20a%20TCP%20proxy.)?
I can see that it could work when TLS isn't used. With TLS, I don't think it could work unless SNI proxying is used. Perhaps that would be a way forward, introducing SNI proxying in the Pulsar Proxy itself? I guess it would also require client side SNI proxying support which already exists, but has to be explicitly enabled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] coderzc commented on issue #15631: [PIP-168] Support zero-copy of NIC to NIC on Proxy
Posted by GitBox <gi...@apache.org>.
coderzc commented on issue #15631:
URL: https://github.com/apache/pulsar/issues/15631#issuecomment-1132728155
> @coderzc Are you thinking of covering TLS too? Is it technically even possible in that case?
>
> I guess a SNI Proxy could handle that with TLS, but not Pulsar Proxy.
yes, I thinking of covering TLS too, but I want to try transform the `SslHandler` to make it possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org