Details

    • 10.1.7-1, 10.1.7-2, 10.1.8-1, 10.1.8-3

    Description

      Supporting socket activation would make each of the following possible for admins:

      • Cleaner restarts (the listener socket stays open persistently)
      • Network namespace isolation, disallowing any network access beyond the inherited listener port (and connections accepted from it).
      • Lazy startup for densely hosted instances. (It's also possible with socket activation to start it eagerly, as usual.)
      • Running MariaDB on privileged ports without having to start it initially as root
      • Non-racy startup for services (like a PHP site) that depend on connecting to MariaDB. Because systemd opens listener sockets early in boot, they're available even while MariaDB is starting
      • Deeper integration into coming network support in future systemd releases

      Some examples in C are here:
      http://0pointer.de/blog/projects/socket-activation.html

      I am willing to sponsor development of this feature.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment - Please review: https://github.com/MariaDB/server/pull/1783
            danblack Daniel Black added a comment -

            Thanks for your patience all. This will be in 10.6.

            danblack Daniel Black added a comment - Thanks for your patience all. This will be in 10.6.
            danblack Daniel Black added a comment -

            In this implementation and discussion there has been nothing mentioned on auto-deactivation. Is this a requirement in densely hosted instances? If so create a separate JIRA issue.

            If something like a max_idle_execution time maybe. There are avenues for integration with RuntimeMaxSec and extending timeout of runtime, and/or purely terminating the listening execution loop if no new connections are happening or queries running.

            But please, new issue and state the requirement first.

            Documentation will be coming in the next week or so https://mariadb.com/kb/en/systemd/

            danblack Daniel Black added a comment - In this implementation and discussion there has been nothing mentioned on auto-deactivation. Is this a requirement in densely hosted instances? If so create a separate JIRA issue. If something like a max_idle_execution time maybe. There are avenues for integration with RuntimeMaxSec and extending timeout of runtime, and/or purely terminating the listening execution loop if no new connections are happening or queries running. But please, new issue and state the requirement first. Documentation will be coming in the next week or so https://mariadb.com/kb/en/systemd/
            davidstrauss David Strauss added a comment - - edited

            In this implementation and discussion there has been nothing mentioned on auto-deactivation. Is this a requirement in densely hosted instances?

            I wouldn't make it a requirement for this issue, even if it's an interesting capability. The socket activation should already mean that it's possible to shut down a MariaDB service that's about to get a new connection and have everything still work. A shutdown immediately followed by a connection attempt should cause systemd's own handling of the socket to enqueue the necessary work to re-launch the service. On the client side, the only thing that should be noticeable is a delay in the initial connection (while MariaDB starts).

            After MDEV-5536, it should be possible to analyze MariaDB activity however one chooses and send "systemctl stop something.service" while being confident that they're not causing system breakage if they anticipated wrongly (and a new connection or query arrives after the analysis or decision to shut down).

            So, self shutdown on idleness would be a complementary feature, but it's pretty separate. Socket activation is the main thing that unblocks the "MariaDB farm" use case because that part is what you can't easily do externally.

            I agree that a separate issue is warranted.

            davidstrauss David Strauss added a comment - - edited In this implementation and discussion there has been nothing mentioned on auto-deactivation. Is this a requirement in densely hosted instances? I wouldn't make it a requirement for this issue, even if it's an interesting capability. The socket activation should already mean that it's possible to shut down a MariaDB service that's about to get a new connection and have everything still work. A shutdown immediately followed by a connection attempt should cause systemd's own handling of the socket to enqueue the necessary work to re-launch the service. On the client side, the only thing that should be noticeable is a delay in the initial connection (while MariaDB starts). After MDEV-5536 , it should be possible to analyze MariaDB activity however one chooses and send "systemctl stop something.service" while being confident that they're not causing system breakage if they anticipated wrongly (and a new connection or query arrives after the analysis or decision to shut down). So, self shutdown on idleness would be a complementary feature, but it's pretty separate. Socket activation is the main thing that unblocks the "MariaDB farm" use case because that part is what you can't easily do externally. I agree that a separate issue is warranted.
            davidstrauss David Strauss added a comment -

            I've posted a separate issue for automatic shutdown when idle: MDEV-25282

            davidstrauss David Strauss added a comment - I've posted a separate issue for automatic shutdown when idle: MDEV-25282

            People

              danblack Daniel Black
              davidstrauss David Strauss
              Votes:
              16 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.