techiev2's current lifestream

Two Birds

Does 70MB sound like a lot?

“It depends” is a great answer.

On my VPS that powers crisp, where I have 20 process runners and three web/ping servers, that’s a steal. Even when the processes themselves are lean enough to be both Tamirat Tola and Usain Bolt, that’s a welcome win.

But that was somehow not the thought when I embarked on a change late this evening, but ended up a sweet surprise as I eased into the night.

While I was moving out of work last evening, someone had asked about crisp’s URL. As Murphy’s law of demos would go, he saw a 502 — eggs on a vegetarian’s face.

Tail between my legs, as I told him the server is down and I’ll check, a loud voice at the back of my head went, “I told you so.” Not a new one, not a frequent on either, thankfully. As I moved out of office, the thought ate up most of my focus chewing the cud on why would I let this happen.

Thanks to Bengaluru’s infrastructure that gets final usable budgets as much perhaps as my VPS bills, signals and traffic snarls are a certain chagrin. Today however, the two extra minutes helped — fired up an SSH session from the scooter and resurrected the app.

A 30 minute ordeal later, as I sat down for dinner, the first question that came up was point blank — “Why are you not using systemd units?”

The simplicity and the dependability on the one hand, the mental math went an extra step — it reduces further shell forks in your runner script, you don’t have tmux session/server overheads.

Lo and behold, even as one of the processes was a bit of an indignant toddler, the 15 min tussle with setting up the entirety gave a massive win — a 70MB reduction in mean memory consumption.

Honey, I shrunk the system memory

As I said with the opening line, to many a services where GBs are norm, this isn’t something that turns heads. But, for every attempt that goes towards pushing the efficiency envelope even further, this is a wonderful whiff of a mountain breeze.