flipkart-incubator / phantom

Phantom is a high performance proxy for accessing distributed services. It is an RPC system with support for different transports and protocols. Phantom is inspired by Twitter Finagle clients and builds on the capabilities of technologies like Netty, Unix Domain Sockets, Netflix Hystrix and Spring. Phantom proxies have been used to serve several hundred million API calls in production deployments at Flipkart.
49 stars 27 forks source link

Benchmark Suite #88

Open ChakshuGautam opened 2 years ago

ChakshuGautam commented 2 years ago

I was not able to find a benchmarking suite for this. If there is something already available, please point me to that direction. What I am looking for is a simple suite that spins up minimal services of all/some protocols and benchmarks them against a phantom instance. Added chaos can help see how it responds to error.

If there are already published benchmarks somewhere, that can help too.

Thanks.

pmohankumar commented 2 years ago

I don't think we've benchmarks or suite yet for phantom. @regunathb please correct me if am wrong

regunathb commented 2 years ago

Yes, that's right. We don't have a benchmarking suite. All our benchmarking tests were run initially against an incumbent (internal source) sidecar we had at Flipkart called the W3Agent which worked over Unix Domain Sockets. That said, all the protocol parsing stuff is stateless and memory allocation/gc-ing should happen within young gen. I expect Phantom to max out much after you saturate the network to the host.

ChakshuGautam commented 2 years ago

Yes, that's right. We don't have a benchmarking suite. All our benchmarking tests were run initially against an incumbent (internal source) sidecar we had at Flipkart called the W3Agent which worked over Unix Domain Sockets. That said, all the protocol parsing stuff is stateless and memory allocation/gc-ing should happen within young gen. I expect Phantom to max out much after you saturate the network to the host.

This helps. Thanks @regunathb

ChakshuGautam commented 2 years ago

Hey, @regunathb @pmohankumar don't you think the total number of active connections will exhaust the memory before the network throttles? How much young gen memory are we talking about in this case?

regunathb commented 2 years ago

A typical deployment for a Phantom reverse proxy will be to support connections from a handful of clients and with each having tens of connections or to deploy Phantom as a side car on the same host as the client. In these cases, you will hardly see a couple of hundred active connections, which per se will not exhaust memory. What you do on these connections will saturate the network or cause Phantom to run out of memory (if you process large payloads). Btw, what is your use case/requirement on Phantom?

ChakshuGautam commented 2 years ago

@regunathb We have a service that allows use to fetch data from third party services using an adapter pattern. I wanted to add Phantom in the middle to monitor (using the Hystrix dashboard) all calls to those third party services and notify them (as a Hystrix fallback) when they are slow or not following their SLAs. Do you think it would be a good fit for the same?

All third party providers onboard their service as a plugin, so we would need to dynamically onboard them to phantom as well.

regunathb commented 2 years ago

Yes, Phantom should work. For API composition from upstream calls in a declarative manner, you may also want to look at : Poseidon, https://github.com/flipkart-incubator/Poseidon/tree/master/sample#poseidon-sample