We encounter grief at various stages in life. It could be personal loss,disappointment or loss of a beloved one. When at each stage we encounter grief it changes a part of us. However small cause may be it changes I guess at least one neuron connection. I have had numerous such encounters. The most significant is the one when I lost my grandfather. Today I lost a second one and just watching him lie there still evoked the trauma that I underwent when I lost my first grandfather. At some moments I could see him lie there and not my second grandfather. It was in way creepy. But in few moments I realized it was the sign of how much I missed him and the size of his influence on me. I realize this will also change me a bit. Teaching me something that I would realize at a later stage. Grief changes and teaches.
The documentation says that we need to run mysql as “root” user for it to be effective. The code also indicates the same thing where it tries to do a getuid call to check if the server is running as root user (sql/mysqld.cc: if (locked_in_memory && !getuid())). The general rule of thumb is that we don’t want to run mysql or rather any database as root user since that leads to vulnerabilities.
Historically memlock seems to cause issues on some OS flavors where “mlockall” implementation is not stable. This is documented in mysql code with the below warning message.
The "–memlock" argument, which was enabled, uses system calls that are
unreliable and unstable on some operating systems and operating-system
versions (notably, some versions of Linux). This crash could be due to use
of those buggy OS calls. You should consider whether you really need the
"–memlock" parameter and/or consult the OS distributer about "mlockall"
On machines where only the database is hosted, if the memory sizing and parameters are set optimally we might never want to use memlock. It might be effective to use “memlock” in machines where the database co-exists with the application code and possibility of the database memory buffers getting swapped out is very high. Even on optimally sized standalone database machines due to various reasons (Jeremy has a nice blog post on this), there are chances of the database memory buffers getting swapped.
“memlock” seems to be a good option to pin the database in memory. But given the caveat that the servers needs to run as root user makes this option not usable in production since we don’t want to open up to vulnerabilities. Is there a workaround to use “memlock” in production or rather what would be the recommended way of using it.
Cinthiya(my sister) called me and said that the Annual Thanks Giving Service at Karunya is being hosted live on the web. Watching it gave me a nostalgic feeling of the good old days in Karunya where i was part of the Mega Play Team. I managed to record part of the stream though the video quality is not great. The below video is an extract containing the final choreography in which my sister was part of.