I apply the unusual procedure, of hosting this Web-site and blog, on a personal computer at home, which I name ‘Pheonix’ on my LAN, and not on a professional hosting-service. What this results in is a personal computer, which has an unusually large amount of RAM dedicated to non-user processes, such as for instance the Apache Web server, the MySQL server, and various other services that assist in hosting the actual site, while also assigning much RAM to my user-space processes, that create a full KDE desktop-session.
It would be an oversimplification to say, that the system-services actually run as root, because many of them switch from root to a different user-name, that just exists for one Web-service to run, but which is not root, simply to protect my computer against eventual hacking-attempts. For example, if my Web-server was to run entirely as root, and if a hacker was able to find a PHP-scripting vulnerability, he could get the thread in question to vandalize my whole computer. But in reality, the Apache thread he’d be hijacking runs with limited privileges…
One of the facts about this setup that is not ideal, is that the user-space processes that create my desktop-session, from my perspective in the foreground, actually take up more RAM than my Web-services do, just because I have such an extensive KDE setup, with PIM-services etc.. What actually happens is that as this user-session continues to run, there is a miscellanea of memory-leaks within, due to which more and more virtual addresses are allocated. Fortunately, because this is also a 64-bit system, the risk is very small, that it could actually ‘run out of 64-bit numbers’ to assign. But what this does also mean, is that an increasing amount of data – most of that presumably garbage – gets swapped out into my swap-partition over time.
This can make me feel uncomfortable, because when and if the next power-failure hits, I could lose data, simply because data which was not garbage, could be swapped-out at that moment. So when this type of imbalance has reached a certain point, what I tend to do is a log-out / log-in. This maneuver does not really reboot the computer, unmount my file-systems, or restart the kernel. It just tells my extensive desktop-session to save all its data to permanent files and databases, to exit, and then to restart. My system-processes continue to run, unaffected. Therefore, the visibility of my site, and of this blog, are not affected at all, when I do this, as long as the procedure went smoothly.
This afternoon, I enacted this procedure, and it went smoothly.
There is a tiny way in which something could go wrong: Doing this also restarts the X-server. And, not 100% of all attempts to restart the X-server, actually succeed. If this did not succeed, I would also have to reboot the computer – for real. But it did succeed.
The current, non-user, kernel-session, has been running for 39 days and 8 hours as I’m typing this, and there are 670 processes running.
One observation which I may log, is that unlike before, after I logged back in, there was still some small amount of swap being used. In the past, the amount of swap used would actually go down to zero. This change in behavior is probably due to the fact that I now also have a “Plex server” running, which means that the total amount of RAM being taken by system-processes, is actually starting to catch up with the amount taken, by my user-processes. So the amount of server-resources taken, has by now added up to become non-trivial.
But that is also why I have 600+ processes now.