Skip to content

Instantly share code, notes, and snippets.

@hatak
Created April 17, 2012 02:59
Show Gist options
  • Save hatak/2403090 to your computer and use it in GitHub Desktop.
Save hatak/2403090 to your computer and use it in GitHub Desktop.
patch for "swap insanity" probrem
--- /usr/bin/mysqld_safe.orig 2011-05-12 03:14:52.000000000 +0900
+++ /usr/bin/mysqld_safe 2011-06-07 11:02:49.000000000 +0900
@@ -727,6 +727,10 @@
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
+# Start mysqld with memory allocations interleaved to avoid swapping
+# on NUMA-based architectures. Should be harmless on non-NUMA.
+cmd="/usr/bin/numactl --interleave all $cmd"
+
for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \
"--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION"
do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment