Systemd for Developers

Systemd not only brings improvements for administrators and users, it also brings a (small) number of new APIs with it. In this blog story (which might become the first of a series) I hope to shed some light on one of the most important new APIs in systemd:

Socket Activation – In the original blog story about systemd I tried to explain why socket activation is a wonderful technology to spawn services. Let’s reiterate the background here a bit.

The basic idea of socket activation is not new. The inetd superserver was a standard component of most Linux and Unix systems since time began: instead of spawning all local Internet services already at boot, the superserver would listen on behalf of the services and whenever a connection would come in an instance of the respective service would be spawned.

This allowed relatively weak machines with few resources to offer a big variety of services at the same time. However it quickly got a reputation for being somewhat slow: since daemons would be spawned for each incoming connection a lot of time was spent on forking and initialization of the services — once for each connection, instead of once for them all.

Spawning one instance per connection was how inetd was primarily used, even though inetd actually understood another mode: on the first incoming connection it would notice this via poll() (or select()) and spawn a single instance for all future connections. (This was controllable with the wait/nowait options.)

That way the first connection would be slow to set up, but subsequent ones would be as fast as with a standalone service. In this mode inetd would work in a true on-demand mode: a service would be made available lazily when it was required. Continue reading…

Related Posts

Manual disk partitioning guide for Linux Mint 17 KDE This tutorial provides a handy, manual disk partitioning guide for the KDE edition of Linux Mint 17, which comes with an installer that has an interfa...
Disk partitioning guide for Linux Mint Debian Linux Mint Debian is the latest version of Linux Mint. Unlike other versions of Mint, it is not based on Ubuntu, but rather on Debian Testing, and com...
Digital Science Studio and the HTTP code: 500, type: java.io.IOException error Digital Science Studio (DSS) "is a software platform that aggregates all the steps and big data tools necessary to get from raw data to production rea...
How to protect against image hotlinking in Nginx This short tutorial shows how I configured Nginx to protect against hotlinking of images used in my articles. Protecting against image hotlinking in N...
Manual disk partitioning guide for Linux Mint 11 This article provides a step-by-step guide on how to create partitions on Linux Mint 11, the latest stable release of Linux Mint. And because it encom...
10 tips for a 10x performance boost for your website or Web app How fast does a website need to be? For each second a page takes to load, about 4% of users abandon it. Top e-commerce sites offer a time to first int...

We Recommend These Vendors and Free Offers

ContainerizeThis 2016 is a free, 2-day conference for all things containers and big data. Featured, will be presentations and free, hands-on workshops. Learn more at ContainerizeThis.com

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).

Want to become an expert ethical hacker and penetration tester? Request your free video training course of Online Penetration Testing and Ethical Hacking

Whether you're new to Linux or are a Linux guru, you can learn a lot more about the Linux kernel by requesting your free ebook of Linux Kernel In A Nutshell.


Leave a Comment

Your email address will not be published. Required fields are marked *

*