Emre ARALCEO, CTO and Fullstack Developer

We were losing 95% of Solana swaps, and it wasn't the code

We were losing 95% of our Solana swaps, and the issue had nothing to do with the code.

Our Solana Parser tracks DEXs via the Yellowstone gRPC stream, processes every swap, writes the parsed data to a database, and simultaneously relays it to clients in real-time. In our production environment, we were processing about 18 transactions per second, and we realized something was wrong. When we set it up on a machine in Frankfurt for testing—using the exact same filters, settings, and code—we immediately spotted the problem: 550–1,028 transactions per second.

The Obvious Suspects

We assumed the issue originated on our end. Was the parser too slow? We quickly optimized the goroutines and worker pools, but the numbers remained unchanged. Could it be an HTTP/2 flow control issue? We increased the stream and connection window sizes to 64/128 MB. The numbers shifted only slightly; we still hadn't found the root cause. What about reconnections? The provider was resetting the stream with an RST_STREAM roughly every 10 minutes—totaling about 5,881 reconnections. Each reconnection caused us to skip certain slot ranges on the chain, but that alone shouldn't have caused such a drastic drop; the volume of incoming swaps per second was far too low to overwhelm the system, even with those gaps. We sampled 100 slots and even implemented a from_slot replay feature for reconnections, yet nothing fixed it.

The Real Reason

The server’s incoming traffic graph was a flat line at approximately 6.1 MB/s. A goddamn flat line—straight as the border between Syria and Turkey.

It turned out the virtual machine in Istanbul supposedly had an incoming bandwidth limit of only about 50 Mbit/s. Why do I say "supposedly"? Because these godforsaken Turkish hosting companies sometimes show you only what they want you to see. They claim—everywhere, including the checkout page—that their machines have "unlimited" capacity; yet, when you dig into the fine print—written in text so tiny it’s practically invisible—you discover they’ve capped your bandwidth at a mere 50 Mbit/s. Our CEX parsers alone, via their WebSocket connections, were consuming about 5 MB/s of that. Once you factor in the database, APIs, and a multitude of other blockchain parsers, there was simply no room left for the Solana parser—leaving gRPC to just do the best it could under the circumstances.

The Solution

We moved the Solana parser to our server in Frankfurt. Data is now compressed using gzip before being sent to our database in Istanbul.

The Result: 562–1019 transactions per second (tx/s), with a p50 latency of 3–6 ms.

If your data processing capacity deviates from your expectations by an order of magnitude (and I mean, say, a factor of ten), I suggest you examine other parts of your infrastructure before assuming the fault lies in your code.

Share:X