CatOps
5.68K subscribers
94 photos
4 videos
19 files
2.25K links
DevOps and other issues by Yurii Rochniak (@grem1in) - SRE @ Preply && Maksym Vlasov (@MaxymVlasov) - Engineer @ Star. Opinions on our own.

We do not post ads including event announcements. Please, do not bother us with such requests!
Download Telegram
В версии ядра Linux 3.9 (ага, давно) добавили такую фичу для сокетов как SO_REUSEPORT aka port sharding. Смысл в том, что несколько процессов могут слушать один и тот же порт, а ядро само разрулит, кому что посылать. Ну код должен со своей стороны эту фичу тоже поддерживать, конечно же

Так вот, зачем оно надо? А затем, что можно делать zero-downtime деплой даже не в кластер. Можно даже делать zero-downtime деплой на отдельновзятой машине в кластере. Конечно, это не так актуально, если у вас действительно всё кластеризировано, но всё равно интересно

Небольшая презентация об этом деле с примерами кода на Python и Ruby:
https://speakerdeck.com/joewalnes/linux-port-sharding

#linux
На CatOps опубликовали интересный пост о SO_REUSEPORT (https://t.me/catops/329). Собственно хочу в догонку скинуть старый пост из github о том что не все так хорошо с SO_REUSEPORT на примере Haproxy.

Если коротко, то между прекращением приема сообщений и закрытием сокета может пройти какое-то время (несколько миллисекунд) и все подключения за этот период будут сброшены, потому что старый демон их уже не обрабатывает, но еще не закрыл сокет.
Вариант решения от Haproxy — дропать syn запросы на этот период. Вариант решения от GitHub (и nginx) использовать отдельный демон, который будет держать сокет открытым.
​​Хорошая статья про swap и memory management в Linux вообще.

https://chrisdown.name/2018/01/02/in-defence-of-swap.html

Тем более, что об эту тему каждый раз ломается куча копий

P.S: картинка отсюда

#linux #memory #swap
There were a lot of culture posts here lately, but no worries were still in the engineering domain!

So, today I want to share a neat detective/mystery story abut ZFS by Brendan Gregg.

It's called "ZFS Is Mysteriously Eating My CPU" and I won't add any more details here to keep the suspense.

Enjoy!

#performance #linux
​​Sometimes it is worth getting your head from clouds down to Earth.

Here is a great post-mortem story of a failed Ceph cluster.

The investigation led them down to more “invisible” underlying layers rather than just Ceph itself, but I won’t spoil more. This is an interesting and not that long read, so you can go through it yourself. Also, at least for me, every post-mortem looks like a detective story, not just a technical article.

P.S. I haven’t worked much with Ceph myself. When I was a very junior engineer, we had a few small Ceph clusters in a company I worked for. I was not involved in that project, though. However, I remember that once we had an issue with one of the clusters and my colleague spent a night fixing it.

The next day he said: “We didn’t quite lose the data. We just cannot retrieve it”. I think from that time this became a strong association for me with Ceph, even though Ceph is usually not the case.

#postmortem #ceph #linux
A nice overview of how Docker works on non-Linux hosts as well as an explanation, why I/O operations are so slow. Plus, some hints on how to make it faster for the local development.

tl;dr. Because Docker requires Linux capabilities, thus is has to have Linux VM to run Linux-based images on MacOS and Windows. This VM shares filesystem with the host, which is slow. There’s a new implementation VirtioFS, which is faster, but still not ideal.

We briefly discussed ways of running Docker on the new M-based Macs on our previous voice chat and this article has links to some tools we mentioned there, specifically: Rancher Desktop and Colima.

Also, I recall developers at my previous job complaining about slow-ish Docker performance, but IIRC VirtioFS was not widely adopted back then.

#docker #linux
From our subscriber:

Till the end of June you can save up to 40% on the Linux Foundation courses with this promo code:

JUNEBBQ40

UPD. Also, AWS has extended the promo code for exam retake. So, if you fail the exam the first time, you can retake it for free. More details:

AWSRETAKE

#linux #education #kubernetes #aws