-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gocircuit channel's performance #19
Comments
The channel sends data across TCP pretty much unmodified. There is one small RPC protocol frame around each transmission. That's the only overhead. I don't know how efficient it is, specifically, but I expect it to be quite reasonable. |
I have 2 sides questions:
Thanks. |
Go's RPC and the circuit are unrelated. The circuit hasn't had bug reports in a long while, so I believe it is On 4 March 2015 at 18:48, briantk1988 [email protected] wrote:
|
Since the circuit is a service discovery framework, I think that it's natural to ask how to use the two together. Since the two are separated, I guess the only way is get the ip address from the circuit (is this possible?) and then call rpc as usual. Is that correct? Please correct me if I'm wrong (I'm very new to go). Thanks. |
Soon there will be a tutorial on the site that answers your questions. For now, see if this helps: Say you want to launch a server process on host1 and a client process Since you are the party launching both processes, you can arrange that For instance, when you start the server process you can remember or just If you are wondering how to discover the IP address of a particular Use the circuit to run a shell command on the target host, which ifconfig en0 | grep 'inet ' | awk '{print $2}' Cheers Petar On 5 March 2015 at 21:35, briantk1988 [email protected] wrote:
|
This is very helpful! Thank you. There's one thing that confuses me a bit in this phrase "when you start the server process you can remember or just set what IP address it listens to." To my understanding, most computers have one ip address, which is automatically also the ip address of the circuit server. However, when you start a circuit server, you always indicate the ip address (instead of just the port, for example). What is the reason behind this? Thanks. |
In some datacenter computers can have more than one IP. If you are playing at home, you can just use 127.0.0.1 On 6 March 2015 at 22:44, briantk1988 [email protected] wrote:
|
Thanks. I suppose that the ipaddr of each circuit host is stored somewhere. So, is it possible to retrieve it via some circuit api instead of running the shell command? Another comment/question: currently, via the join/leave channel, we can detect easily when a new host has been added to the circuit. Is it possible to have the same thing for other objects inside the anchor path (like process/channel etc.)? This would be quite convenient and useful! |
On 7 March 2015 at 23:04, briantk1988 [email protected] wrote:
|
Thanks for informing me about the Peek() api. Re join/leave: the join/leave for hosts facilitates host discovery, while the join/leave for general elements in the anchor path can help facilitate service discovery. Of course, you can always do Thanks. |
See inline: On 9 March 2015 at 09:54, briantk1988 [email protected] wrote:
Hosts have to be discovered by the user software, because the software is General elements are created by the user software, so why would the user
I generally think that the style of cloud programming where "discovering" In a simple single process program, does one ever lose objects they created But even for the case of hosts, having a dedicated channel is already much
Creation of processes, on the other hand, is not caused by external parties. Death of processes, on the other hand, is not caused by the software. Moreover, in general, elements in the anchor path (representing services)
Cheers
|
Thanks for the very detailed response! I guess I have something different in mind, which I will try to explain below. I would love to hear your opinion. And again, since I'm completely new to this area, your comments are truly appreciated since I can learn a lot from them. Re. Software/external party created general element: Suppose I have a cloud app that has 2 types of servers, say front and back. To start my app, I would run gocircuit at each node, join all of them to the circuit, and then run a particular process (say a program written in golang utilizing the gocircuit api) depending on whether the server is front or back. In the setting, the starting of each process is done by some external party (namely me, and not the software), and so it's asynchronous wrt. the software itself. The first issue to address is how each server knows who is who to communicate (eg. a front server might need to pick one back server for a certain task). One way to solve it is to add an extra name to the path for recognition purposes, and communication is done via gocircuit's channel. When a server needs to communicate it can do an Re. Performance of Question 1: Maybe there's a better way to use Quesiton 2: More importantly, you seem to have something completely different in mind, since you said that a well-designed cloud app shouldn't be too dependent on discovery. I would love to hear how to redesign what I said above into something better. Thanks. |
Inline: On 12 March 2015 at 22:57, briantk1988 [email protected] wrote:
I can give you a short hint: The idea is that you will make multiple P
|
Thanks for the reply!!! About the programming technique you have in mind, as far as I understand, the agents act as admins for the orchestration of the cloud. What I have in mind is essentially self orchestrate, which seems to be one of the goals of GoCircuit. In this paradigm, each circuit host would be notified whenever a new service (process/channel etc.) or host is available, and each would use this info to save a list of service/host it wants to talk to. Of course, having channels for general elements' join/leave is not strictly necessary for this purpose, but it's quite convenient and efficient. What do you think? |
Another quick comment: the tutorial on gocircuit.org seems to gear toward using gocircuit to write an orchestration tool, while my comments above are about embedding gocircuit into the program logic. |
I think more generally, you are asking for a general broadcasting mechanism, You would have something like: circuit make_topic /X123/topic_a circuit make_subscription /X789/subs_a /X123/topic_a circuit send /X123/topic_a MSG circuit recv /X789/subs_a A broadcasting facility would be useful and I'll plan to implement one P On 17 March 2015 at 16:18, briantk1988 [email protected] wrote:
|
New docs look great. Thanks Petar I need to hook a message queue in. I have been using kafka. Any advice. About self orchestration. Ast / cfg if compute graph. Any plans for a reflection based GUI tool ? |
@petar A general mechanism for message broadcasting would be fantastic! Health check for a general element could then be implemented on top of that. @gedw99 Thanks for letting me know about Coopr, I'll take a look into it. Also, by "hooking a message queue" do you mean putting kafka into the circuit, or do you mean implementing a message queue using the circuit? |
Thank you. Well kafka is very full featured for fan in / fan out cfg topologies, so its probably a fair bit of work. The message queue is Wondering what you think about the CFG reflection idea. I am a bit attached to the idea. It would allow the develop as well as a user (think ETL and business reporting) to see the whole big picture or pick a start point and see just that flow. |
Inline: On 19 March 2015 at 02:28, Ged [email protected] wrote:
|
The tutorial just shows how to use the Go API. You can use the API from within your services as well to start new services On 18 March 2015 at 12:33, briantk1988 [email protected] wrote:
|
You could also build a DIY broadcasting service by implementing a This is akin to using the circuit to install something like etcd or nsq. On 19 March 2015 at 09:29, briantk1988 [email protected] wrote:
|
Hi @petar, I just browsed the source code. There seems to be some sort of pubsub already set up, which is used in making the join/leave for hosts. How much work is needed to implement the subscription feature you mentioned above? It seems like it's not too much (though I don't understand the code very well yet). In func (y YTerminal) Make(kind string, arg interface{}) (yelm interface{}, err error) where you make some (rpc?) call r := y.X.Call("Make", kind, arg) but I can't seem to find where Thanks. |
On 28 March 2015 at 22:54, briantk1988 [email protected] wrote:
My RPC library is substantially more powerful than the default one. It needs a documentation update. I'll try to do that this week. P Thanks.
|
Thanks. Your rpc library sounds great! From what you said then probably it doesn't take much work to have the join/leave for general elements in the anchor path. |
I am thinking of using gocircuit's channel to build a message queue. Is the channel fast enough for this kind of thing? Thanks.
The text was updated successfully, but these errors were encountered: