Warui Gideon (@_byteSlinger_) header
Warui Gideon (@_byteSlinger_) profile picture

Solutions Architect | Platform Engineer | Lifelong Tech Learner | Problem Solver Extra-ordinaire

Joined April 2016
Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)Photo by Warui Gideon (@_byteSlinger_)
For more context; The API team (external vendor) kept reporting that requests were slow at peak. I’d already given the service 16 vCPU and 62 GB of RAM as requested. When I pulled up the host dashboards, I could see the slowdown happening alongside a pattern I wanted to understand before adding any more capacity. For about 2-3 days, available memory kept dropping at peak and load average climbed as high as 34 on 16 cores. CPU still had headroom. At the worst point, even SSH stopped responding. When the box came back, I checked dmesg and found no OOM kill. My concern was that I’d keep giving it bigger boxes every time it got slow, so I wanted to find out where the RAM was going and give the team something concrete to work with. The application logs gave me timings for each stage, but those timings didn’t account for the full request time. I started taking snapshots of memory by process. The previous day, the Gunicorn workers had been using between 6.7 and 8.8 GB each. On the next snapshot, their RSS was 19.2 GB, 17.9 GB, 8.9 GB and 8.6 GB. All four had been up for 8.6 hours. The host had 2 GB available and no swap. I’d already cut the worker count from eight to four. Seeing those two workers at nearly 20 GB each explained why the problem could come back even with half as many workers. During the incident, I sent SIGTERM to the 19 GB worker. It drained, the Gunicorn master started a replacement, and we recovered the memory without seeing dropped requests. I did lose a few minutes to kill -0 first. I saw it fail and assumed the process was gone. The error was EPERM. The worker was still there. I shared the snapshots with the application team. Gunicorn had no --max-requests set, so the workers could keep growing for their entire lifetime. They deploy several times a day, which recycles the workers before the growth is obvious. The Gunicorn change was one line: --max-requests 500 --max-requests-jitter 50 That recycles workers after 500 to 550 requests and staggers the restarts. Host memory utilisation went from around 99% at the worst point to about 15% on average after the change. We stayed on the same box. On the infrastructure side, I set per-container memory limits with headroom for the host and added them to Compose so they’d carry through the next deploy. I also started scraping memory PSI. During those three days, the dashboards showed me memory falling and load rising. What I was missing was how much time tasks were spending stalled on memory. I can see that now in some avg60 from /proc/pressure/memory, while I can still get onto the box and investigate. This is a summary. (Mini-RCA, sort of ). I hope it helps.
Stuff we live for, hii inanipeleka hadi 2027🤣💫
6
8
1
50
2,016
Stuff we live for, hii inanipeleka hadi 2027🤣💫
4
1
1
47
3,143
Replying to @Ricky_customs
@Ricky_customs thank you for the awesome services. Satified is an understatement. See you again after ROI🤣💯💫
2
3
1
3
1,313
Replying to @millxn_
@millxn_ dis you?
wtf is a founding intern😭😭😭
1
328
Trust @Ricky_customs to handle matters electronics. Great quality and easy lad. 💫💯
4
2
8
1,409
Replying to @Safaricom_Care
@Safaricom_Care I've been trying to reach 400 on call for home fiber services from yesterday, and no luck. Kwani namna gani?
1
178
_type shiii_🎉🎉🎉🎉🎉
2
254
Me: Front Door is down, but I'm on your front door. Sends to many🤡
2
1
2
226
+1. Grateful for another year🥳
4
20
736
Foreman leo amechemka. Anyway, GIS Data CDC pipeline from SQL Server to Postgres/PostGis. Preferred Stack Debezium Kafka with a custom sink tranform from mssql geom to postgis geom data types among others. 🥳🥳
1
144
Lessons for today: websockets and Nginx configs on AKS is not to be overlooked. Azure UAMI and role assignments have shown me dust today. Anyway, platform is live for Internal Users.🥳🥳🥳
1
2
15
729
The stage has been set for the play. #SiriNiNumbers
1
101
It's the delusion for me and detachment from reality. #SiriNiNumbers
2
149
In whose hands are we safe!!??😪
1
113
Teargas being drop-shipped to your nearest location. Talk about last mile delivery. Huyu mzee namna gani?🤡##SiriNiNumbers #RutoMustGo. #veryreadyfortuesday.
1
1
409
Not to be a conspiracy theorist or anything, the rabbit hole led me here😅. Anyway #SiriNiNumbers #RutoMustGo
72
Whoever heads Standard Group Media. Top G that one, they will go to heaven🫡
The Standard Group's Response to CA's Media Blackout Threat
2
242