Posted on 4 Comments

ulimit, taskset for mysqld

my.cnf can take the open_files_limit=N option in the [mysqld_safe] block. This doesn’t do anything to mysqld directly, instead the mysqld_safe script calls ulimit -n <N>

These days, we might want to limit mysqld to use a maximum of 4 cores (using taskset on Linux) so InnoDB performance doesn’t degrade. Of course this is only relevant on machines with more than 4 cores (like boxes with 2 quadcore CPUs), but still, it’s nice to not have to hack mysqld_safe for such changes, as it makes upgrades less fussy and keeps config info in the one place (my.cnf).

Peter and I were discussing this, and I suggested two new options for mysqld_safe, one for pre-mysqld and one for post-mysqld commands that need to be run. Calling ulimit would be a pre-mysqld task, but taskset is post.
The one thing is that taskset needs to be passed the PID, so we must provide a way to pass that through the config dynamically.

We know that MySQL wants to get rid of mysqld_safe in favour of the Instance Manager, but that’s been a long time and it hasn’t happened yet.

Thoughts/ideas welcome, before we make a patch for this.

Posted on 4 Comments

4 thoughts on “ulimit, taskset for mysqld

  1. MySQL wanted to to get rid of mysqld_safe in favour of the Instance Manager. Not anymore. If you look at the 6.0 branch you wouldn’t find instance manager there – it was removed.

  2. I wouldn’t necessarily take that as an expression of a policy decision, but it’s possible 😉

  3. Old news. It’s officially deprecated as of 5.1 and non-security bugs have been closed with unsupported feature status since October 2007. It’s gone in 6.0.

    In the unlikely event that someone actually wants to use it, I’m not aware of anything that will prevent people from using the current version with later releases. I doubt that many people will be sad to see its demise.

  4. It was not finished by any means, or perhaps not even (well) designed.
    But its objective was useful, allowing remote start/stop and control over MySQL instances.

Comments are closed.