Gophers

From a thought to the roll.

How to write the performant micro-services using minimal cores and memory.

KT
3 min readMay 18, 2019

--

We had our services rolled into production cloud but performance wasn’t great!

I like Java, wrote most of the critical services using it and spent hours and months in tuning it but still couldn’t make Teja our performance guy happy, when comes to performance. With cloud, comes the pods, the miniature vms with limited cores and memory to run your micro-service and auto scaling pods to take the load. Teja was never happy with the number of pods our services were using. During prime time, number of cores and memory was spiking up like crazy. Well, wasn’t the happy look at grafana at all :(

After spending significant time in tuning memory and Java threading model and getting trashed by the results, we started exploring new tools, better for micro-services and cloud world. Rob pike talk on concurrency and parallelism inspired me to start exploring GO. On sharing thoughts about writing in GO, within few days, like the magnetic act all the GO lovers came together and the beautiful journey began! Kyle, Fido, Jorge, Joel and Me.

Before we accept the GO language tool, it was needed to establish the numbers. We came up with numbers on memory, cores, docker size and service start up time using Java, NodeJS and GO. Fido wrote a service in all three languages, service was doing a single job of reading from the couchbase bucket. GO shined in all comparisons, memory footprint is barely visible, service startup time is speed fast, docker image size is low and cores are low in comparison with Java.

GO vs Java vs NodeJS

Kyle been most experienced in GO along with Fido led us to write basic SDKs and we had the SDKs to write our first business problem to establish GO is fit to solve enterprise problem.

We pick the business service taking highest customer traffic and most costly, it was top in cost calculator’s list. Hell lot of business logic we had to re-write. For few months, Yang, Robert, Mojgan’s and Me were on see saw, scaling up and down our service in prod, missing business cases. Finally, after several attempts our service is running in production and shining like a gem. Numbers shows it all!

We came down in cost calculators list from $21.75K per month to $1.67K per month.

JAVA vs GO

GO has many benefits

Speed of Compilation

Speed of Execution

Deployment and service startup time speed

Low memory and CPU footprint. Reduce platform cost.

Strongly typed

Better fit for micro-service architecture.

Based on my learning and time I spent moving the most painful service in GO, I found that writing the threading model in GO is significantly easy and quick to achieve. I like the fact that GO creators preferred simplicity, readability over adding many features, it has no bloat. It gives you what you need to write high performing software. Here are thoughts from the guys I worked with :)

GO GO GO

And here comes the roll, numbers which were established by some of us -misfits (Fido gave this name) were flying around and why not it is indeed adding a lot of value. We got the support! GO at our company is rolling in, more impactful folks are supporting GO effort! We have our GO SDK ready and some of our services are already rolled into production and doing awesome!

With new cloud world, re-thinking is needed to establish tools which better fits the cloud technology, GO is one of it! Thanks to Robert Griesemer, Rob Pike, and Ken Thompson and google. Cheers to all gophers!

--

--