RPC over AMQP
hydrogen18.com
hydrogen18.com
Using MessagePack would speed that up significantly, too. I've done a comparison of MessagePack vs. JSON vs. YAML vs. Ruby .marshal in the past[0], and I'm currently building a system using AMQP+MessagePack (as of now the only part that's public is [1]).
Basically, YAML is great for configuration files because of its flexible syntax, but terrible for communication because of its flexible syntax.
[0] http://blog.mikebourgeous.com/2012/10/12/optimizing-message-... (missing numbers for MessagePack, but mentions 2x speed up beyond best other option)
[1] https://github.com/deseretbook/classy_hash (includes a benchmark script that shows how ridiculously fast MessagePack is compared to YAML)
Unfortunately, upgrading the server component is trivial but upgrading all the clients is next to impossible. The logical next step after this project is to implement a saner set of endpoints that breaks up all the amalgamated functions. At some point in the future, there will come a day in which we'll simply ignore the requests from older clients.
Could the request be changed to use a faster message format instead of YAML?
If YAML can't be replaced, could the YAML marshalling be sped up?
For sure... for example, by rewriting it in another language?
Assuming the following points from the post are correct:
a) the perf problem is YAML marshalling b) that can be solved via a go rewrite
then perhaps an easy way to solve "I want to call the old code" is to access it over HTTP, using a cheaper marshalling method than YAML.
I guess the tradeoff is whether you'd prefer an AMQP broker in there mediating the requests or an HTTP load balancer (or http client pool code in the go app). And whether you see other uses for that broker in your setup.
The documentation describes how it works here: http://docs.spring.io/spring-amqp/reference/htmlsingle/#remo...
My complaint with 0mq is that you wind up needing some sort of service discovery service from what I can tell. In order to get everything working, each client needs to know about at least one servant. Ideally, each client needs to about all servants and use a load balancing algorithm across them. I'd need to keep this configuration at all clients synchronized. I'm aware there are tools to do this, but ultimately I am not the person in charge of operating this.
The project isn't complete but is functional enough to be used in production.