Hi there 馃憢

Welcome to superuser! Expect to find linux, python, SRE and related contents.

Thinking in Multi Dimensions

It鈥檚 been a while since I鈥檝e written something here. I joined Facebook back in Nov 2021 and since then I鈥檝e been away from the Python/Linux/SRE domain and got deeper in facebook specific problems related to capacity management. The work involves full stack php-JS-React-GraphQL, the standard Facebook stack. While I am learning a lot of new things, I did not come across anything worth sharing here. Why thinking in multi dimension? 2023 was the rise of LLMs....

April 27, 2024 路 6 min 路 Sanket

SRECon'21: Leveraging ML to Detect Application HotSpots [@scale, of Course!]

Long pandemic no see! I submitted two proposals for SRECon 20 Asia which was supposed to happen in Australia. One talk got selected. But instead of the conference, COVID-19 happened. The conference was delayed at first and ultimately cancelled. Comes 2021 and now the conference is arranged in virtual format. I submit the selected talk again, under MLOps section and it got selected again. The talk describes the approach to detect application hotspots our team developed in collaboration with the ML team....

October 13, 2021 路 1 min 路 Sanket

Python Metaprogramming: Functions, Flask and Google Cloud Functions

Everything in Python is an object. And that includes functions. Let鈥檚 see what I learned while I was trying to work with Google cloud functions with python runtime. Python Functions Since functions too are objects, we can see what all attributes a function contains as following >>> def hello(name): ... print(f"Hello, {name}!") ... >>> dir(hello) ['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] While there are a lot of them, let鈥檚 look at some interesting ones...

August 11, 2020 路 6 min 路 Sanket

Golang Http Client and Compression

I had a very (seemingly) simple task. Verify my golang http client, talking with an ElasticSearch cluster, is compressing data on wire. Because in trials, there was around 8x data compression and 100ms latency improvement. Sounds simple? Apparently not! ElasticSearch Side of Things Http compression is enabled by default and it鈥檚 an easy configuration. Despite it being enabled by default, still added following in config http.compression: true And verified it works by...

March 31, 2020 路 5 min 路 Sanket

Debugging a Running Python Process

Only if it were as easy as installing debug symbols, attach the process with gdb and py-bt! So we have a python agent, which distributes files, running across the fleet. And on some random hosts, it went haywire! On those set of hosts, the process was using 100% of CPU and not doing anything meaningful work. Restarting the process fixes the problem. I had worked on debugging a stuck process, but this was the opposite....

December 18, 2019 路 7 min 路 Sanket

PyCon19 India: Let's Hunt a Memory Leak

We faced a memory leak in production and I wrote about it in this blog post. A while back, I somewhere came across the open Call for Proposals for Pycon India 2019 and I submitted a talk titled Let's Hunt a Memory Leak. It got selected and I had to prepare! While learning python internals and especially memory related behaviour, I also wrote about werid behaviour with python 2 and integers....

November 15, 2019 路 2 min 路 Sanket

Curious Case of Python 2 and Integers

In Detecting Memory Leak in Python, scenarios were shown where python does not release memory when we created a huge list and then explicitly deleted it. The given explanation was that python caches these objects and does not release the memory back to OS. Let鈥檚 take a deeper look at what exactly happens! Update: I gave a talk at PyCon 2019 on a similar subject, if you prefer detailed explanation in video format, checkout PyCon19 India: Let鈥檚 Hunt a Memory Leak or just scroll down to the bottom of the page....

September 20, 2019 路 7 min 路 Sanket

Site Wide Memory Leak: An On-Call Story

This happened a while back, sometime in the year of 2017. I was on-call for the week and it was the weekend. Usually, things are quiet over the weekends but not that weekend. Pages started coming frequently affecting different hosts. The alert was titled WARNING: Memory usage is more than 80% And that was just not one or set of hosts. This started coming from random hosts from across the infrastructure....

August 14, 2019 路 4 min 路 Sanket

SRECon19 Asia: Let's Build a Distributed File System

In the first post on this blog, I wrote about a tiny distributed filesystem I made in python for educational purpose. This year, I had a chance to use it in a talk delivered at SRECon 19 Asia. The title was Let鈥檚 Build a Distributed File System The talk was listed under something called Core Principles track and Talks in this track will focus on providing a deep understanding of how technologies we use everyday function and why it's important to know these details when supporting and scaling your infrastructure....

July 21, 2019 路 2 min 路 Sanket

Serverless Meets CI/CD

I have been attending LSPE [Large Scale Production Engineering] Meetup for last two years. And for the last one, I decided to give it back to the community. I conducted a hands-on session titled: Serverless meets CI/CD The session briefly introduced what is Serverless and CD/CD and why should you be concerned about it. We then went hands-on with AWS Lambda as serverless platform and Bitbucket Pipelines for CI/CD. Started from making a Hello World!...

December 10, 2018 路 1 min 路 Sanket