[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107933#comment-17107933 ] Tzu-Li (Gordon) Tai edited comment on FLINK-17611 at 5/15/20, 4:43 AM: --- [~igal] concerning the YAML spec format for endpoints with UDS: Does the {{unix://}} scheme convention also support endpoint paths? Otherwise, I also see a {{http+unix://}} convention used by [requests-unixsocket|https://pypi.org/project/requests-unixsocket/] to specify both the socket file path and url when performing HTTP requests over UDS. either way: I like that we use the scheme part of the endpoint URL to determine whether or not to talk via UDS, instead of an extra field in the YAML spec. It seems like a known convention, and is more compact. was (Author: tzulitai): [~igal] concerning the YAML spec format: Does the {{unix://}} scheme convention also support endpoint paths? Otherwise, I also see a {{http+unix://}} convention used by [requests-unixsocket|https://pypi.org/project/requests-unixsocket/] to specify both the socket file path and url when performing HTTP requests over UDS. either way: I like that we use the scheme part of the endpoint URL to determine whether or not to talk via UDS, instead of an extra field in the YAML spec. It seems like a known convention, and is more compact. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Assignee: Francesco Guardiani >Priority: Major > Labels: pull-request-available > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107270#comment-17107270 ] Francesco Guardiani edited comment on FLINK-17611 at 5/14/20, 1:05 PM: --- Opened the PR here: https://github.com/apache/flink-statefun/pull/110 ]I've implemented a solution that uses both endpoint and uds field, to specify both path and socket file, let me know your thoughts about that was (Author: slinkydeveloper): Opened the PR here: [https://github.com/apache/flink-statefun/pull/110 ]I've implemented a solution that uses both endpoint and uds field, to specify both path and socket file, let me know your thoughts about that > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Assignee: Francesco Guardiani >Priority: Major > Labels: pull-request-available > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107244#comment-17107244 ] Igal Shilman edited comment on FLINK-17611 at 5/14/20, 12:11 PM: - [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks think (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket. was (Author: igal): [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks think (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket? > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Assignee: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107244#comment-17107244 ] Igal Shilman edited comment on FLINK-17611 at 5/14/20, 12:11 PM: - [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks think (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: meta: kind: http spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket. was (Author: igal): [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks think (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Assignee: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17107244#comment-17107244 ] Igal Shilman edited comment on FLINK-17611 at 5/14/20, 12:11 PM: - [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks think (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket? was (Author: igal): [~slinkydeveloper] having an endpoint in addition to uds would allow folks to serve their statefun endpoint in a different location than "/". I guess we can simplify here, and make it a requirement that working with a unix domain socket, you must serve the statefun endpoint at "/", I'm okay with that. By the way, peeking at other projects that expose a unix domain socket (for example Docker) the way to specify the path for a unix domain socket is using the unix schema: "unix://". What do you folks thing (cc: [~tzulitai]) about using the endpoint field and deciding by the schema part of the endpoint. For example: {code:java} function: spec: endpoint: unix://mnt/shared/worker.sock {code} would mean that we are using the unix domain socket? > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Assignee: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17106049#comment-17106049 ] Francesco Guardiani edited comment on FLINK-17611 at 5/13/20, 7:28 AM: --- Hi [~igal] , I've used in past UDS with JVM with [Eclipse Vert.x|http://vertx.io/], a popular library to create async applications (based on Netty). What you really gain from UDS is reducing the pressure on the k8s/container engine networking stack, because UDS are implemented in a "memory mapped file" fashion. I've checked out too that okhttp works with UDS, so i think I can start playing with it. I'll let you know what i manage to create, is there any contributing guide i can follow to start with? was (Author: slinkydeveloper): Hi [~igal] , I've used in past UDS with JVM with [Eclipse Vert.x|http://vertx.io], a popular library to create async applications (based on Netty). What you really gain from UDS is reducing the pressure on the k8s/container engine networking stack, because UDS are implemented in a "memory mapped file" fashion. I've checked out too that okhttp works with UDS, so i think I can start playing with it. I'll let you know what i manage to create, is there any contributing guide i can follow to start with? > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17105753#comment-17105753 ] Igal Shilman edited comment on FLINK-17611 at 5/12/20, 9:25 PM: Hi [~slinkydeveloper], Welcome to the project! looking forward to hear about your investigation results with StateFun on k8s! Regarding unix domain sockets, we've discussed this as a potential performance improvement internally, but didn't get to investigate this yet, and any help here would be much appreciated. Before jumping into the implementation details, I'm wondering if you have ever used (or familiar with) unix domain sockets from the JVM, and are they are such a drastic improvement, specifically when used from a JVM? since as far as I can see, using UDS requires JNI. As a side note, I've quickly Googled and found [an example|https://github.com/square/okhttp/tree/master/samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets] of okhttp client (the client that we use for remote http functions) that works with UDS. So possible that could be a starting point for a small experiment. was (Author: igal): Hi [~slinkydeveloper], Welcome to the project! looking forward to hear about your investigation results with StateFun on k8s! Regarding unix domain sockets, we've discussed this as a potential performance improvement internally, but didn't get to investigate this yet, and any help here would be much appreciated. Before jumping into the implementation details, I'm wondering if you have ever used (or familiar with) unix domain sockets from the JVM, and are they are such a drastic improvement, specifically when used from a JVM? since as far as I can see, using UDS requires JNI. As a side note, I've quickly Googled and found[ an example|[https://github.com/square/okhttp/tree/master/samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets]] of okhttp client (the client that we use for remote http functions) that works with UDS. So possible that could be a starting point for a small experiment. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17105753#comment-17105753 ] Igal Shilman edited comment on FLINK-17611 at 5/12/20, 9:24 PM: Hi [~slinkydeveloper], Welcome to the project! looking forward to hear about your investigation results with StateFun on k8s! Regarding unix domain sockets, we've discussed this as a potential performance improvement internally, but didn't get to investigate this yet, and any help here would be much appreciated. Before jumping into the implementation details, I'm wondering if you have ever used (or familiar with) unix domain sockets from the JVM, and are they are such a drastic improvement, specifically when used from a JVM? since as far as I can see, using UDS requires JNI. As a side note, I've quickly Googled and found[ an example|[https://github.com/square/okhttp/tree/master/samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets]] of okhttp client (the client that we use for remote http functions) that works with UDS. So possible that could be a starting point for a small experiment. was (Author: igal): Hi [~slinkydeveloper], Welcome to the project! looking forward to hear about your investigation results with StateFun on k8s! Regarding unix domain sockets, we've discussed this as a potential performance improvement internally, but didn't get to investigate this yet, and any help here would be much appreciated. Before jumping into the implementation details, I'm wondering if you have ever used (or familiar with) unix domain sockets from the JVM, and are they are such a drastic improvement, specifically when used from a JVM? since as far as I can see, using UDS requires JNI. As a side note, I've quickly Googled and found[ an example|[https://github.com/square/okhttp/tree/master/samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets]] of okhttp client (the client that we use for remote http functions) that works with UDS. So possible that could be a starting point for a small benchmark. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17105121#comment-17105121 ] Tzu-Li (Gordon) Tai edited comment on FLINK-17611 at 5/12/20, 6:23 AM: --- I like this a lot, +1. And thanks a lot for bringing this up + willing to implement this! For starters, I'd suggest first looking at how to implement a new {{kind}} of request reply protocol based remote function. For that, I suggest taking a look at the {{JsonModule}} class. In there, you'll find the {{configureFunctions}} method which figures out what functions to provide based on the configured kind in YAML textual modules. From there, you'll also be able to figure out how the HTTP-based request-reply protocol is implemented, as a reference example. In any case, lets also wait for [~igal] to chime in as he'll have the best judgement here. was (Author: tzulitai): I like this a lot, +1. And thanks a lot for bringing this up + willing to implement this! For starters, I'd suggest first looking at how to implement a new {{kind}} of request reply protocol based remote function. For that, I suggest taking a look at the {{JsonModule}} class. In there, you'll find the {{configureFunctions}} method which figures out what functions to provide based on the configured kind. From there, you'll also be able to figure out how the HTTP-based request-reply protocol is implemented, as a reference example. In any case, lets also wait for [~igal] to chime in as he'll have the best judgement here. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (FLINK-17611) Support unix domain sockets for sidecar communication in Stateful Functions
[ https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17105121#comment-17105121 ] Tzu-Li (Gordon) Tai edited comment on FLINK-17611 at 5/12/20, 6:22 AM: --- I like this a lot, +1. And thanks a lot for bringing this up + willing to implement this! For starters, I'd suggest first looking at how to implement a new {{kind}} of request reply protocol based remote function. For that, I suggest taking a look at the {{JsonModule}} class. In there, you'll find the {{configureFunctions}} method which figures out what functions to provide based on the configured kind. From there, you'll also be able to figure out how the HTTP-based request-reply protocol is implemented, as a reference example. In any case, lets also wait for [~igal] to chime in as he'll have the best judgement here. was (Author: tzulitai): I like this a lot, +1. And thanks a lot for bringing this up + willing to implement this! For starters, I'd suggest first looking at how to implement a new {{kind}} of request reply protocol based remote function. For that, I suggest taking a look at the {{JsonModule}} class. In there, you'll find the {{configureFunctions}} method which figures out what functions to provide based on the configured kind. In any case, lets also wait for [~igal] to chime in as he'll have the best judgement here. > Support unix domain sockets for sidecar communication in Stateful Functions > --- > > Key: FLINK-17611 > URL: https://issues.apache.org/jira/browse/FLINK-17611 > Project: Flink > Issue Type: New Feature > Components: Stateful Functions >Reporter: Francesco Guardiani >Priority: Major > Original Estimate: 48h > Remaining Estimate: 48h > > Hi all, > I'm quite new to this project and I've started investigating its potential > usage in Kubernetes. > I've found in past that using Unix Domain Sockets across several containers > in the same pod gives an interesting performance boost and drastically > reduces the overhead of going through the network stack. Given that > containers in a pod run in the same host, it's perfectly reasonable to let > them communicate through unix domain sockets. > If you're interested in such feature, I'm more than willing to help > implementing that, given that I need a few pointers where to start from -- This message was sent by Atlassian Jira (v8.3.4#803005)