Optimizing Large File Transfers in Linux with Go - An Exploration of TCP and Syscall

As I experiment with Raspberry Pi and other devices in my network, I have created a small network application to aid in device discovery using multicast, data collection, and other functions. One key feature of this application is the ability to download various data and metrics from some plugins weekly. With file sizes ranging from 200 MB to 250 MB after applying some compression, it’s essential to carefully consider some approaches for sending these files over TCP using Go....

January 30, 2023 · 9 min · Me

A simple example of using unix domain socket in Kubernetes

In my previous post, Understanding Unix Domain Sockets in Golang, I mentioned that one potential use case for Unix domain sockets is to communicate between containers in Kubernetes. I received requests for an example of how to do this, so in this post, I’ll provide a simple example using two Go applications that you can find in this repository. Using Unix domain sockets in Kubernetes can be an effective way to communicate containers within the same pod....

December 16, 2022 · 4 min · Me

Understanding Unix Domain Sockets in Golang

In Golang, a socket is a communication endpoint that allows a program to send and receive data over a network. There are two main types of sockets in Golang: Unix domain sockets (AF_UNIX) and network sockets (AF_INET|AF_INET6). This blog post will explore some differences between these two types of sockets. Unix domain sockets, a.k.a., local sockets, are used for communication between processes on the same machine. They use a file-based interface and can be accessed using the file system path, just like regular files....

December 5, 2022 · 8 min · Me

How to setup simple load balancing with IPVS, demo with docker

A few days ago, I was reading about the Kubernetes network model, especially about services and the kube-proxy component, and I discovered that kube-proxy has three modes, which are userspace, iptables and ipvs. The userspace mode is too old and slow, nowaday nobody recommends to use it, the iptables mode is the default mode for kube-proxy with this mode kube-proxy use iptables rules to forward packets that are destined for services to a backend for that services, and the last one is ipvs I did not know what it was so I read about it....

April 6, 2020 · 5 min · Me