roxen.lists.roxen.general

Subject Author Date
[PATCH 07/17] Expose MySQL options to the webadmin Stephen R. van den Berg <srb[at]cuci[dot]nl> 20-01-2009
---

 server/base_server/global_variables.pike |   18 ++++++++++++++++++
 server/base_server/roxenloader.pike      |    7 +++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/server/base_server/global_variables.pike
b/server/base_server/global_variables.pike
index 7458c40..9ca7bdb 100644
--- a/server/base_server/global_variables.pike
+++ b/server/base_server/global_variables.pike
@@ -344,6 +344,24 @@ void define_global_variables(  )
 			     Stdio.write_file(combine_path(roxenloader.query_configuration_dir(),
"_mysql_table_check"), options);
 			   });
 
+  defvar("mysqldextraoptions",
+         Variable.Text( "[mysqld]\n"
+			"#query-cache-size = 0M\n"
+			"# The following options can save a lot of memory:\n"
+                        "#skip-innodb\n"
+                        "#skip-bdb\n",
+                        VAR_MORE, LOCALE(0, "Extra mysqld options"),
+                        LOCALE(0, "Specify any additional customisations "
+                               "to tune the internal mysql server "
+                               "of Roxen.")))
+    ->set_changed_callback(lambda(Variable.Variable s)
+			   {
+			     Stdio.write_file(combine_path(
+			        roxenloader.query_configuration_dir(),
+			       "_mysql_extraoptions"),
+			      query("mysqldextraoptions"));
+			   });
+
   defvar("port_options", PortOptions());
 
   defvar("RestoreConnLogFull", 0,
diff --git a/server/base_server/roxenloader.pike
b/server/base_server/roxenloader.pike
index 6c54153..79a596d 100644
--- a/server/base_server/roxenloader.pike
+++ b/server/base_server/roxenloader.pike
@@ -2011,8 +2011,6 @@ void low_start_mysql( string datadir,
 		  "--socket="+datadir+"/socket",
 		  "--pid-file="+pid_file,
 #endif
-		  "--skip-locking",
-		  "--skip-name-resolve",
 		  "--basedir="+basedir,
 		  "--datadir="+datadir,
   });
@@ -2045,13 +2043,14 @@ void low_start_mysql( string datadir,
 		     "set-variable = max_allowed_packet=16M\n"
 		     "set-variable = net_buffer_length=8K\n"
 		     "query-cache-type = 2\n"
-		     "query-cache-size = 32M\n"
 #ifndef UNSAFE_MYSQL
 		     "local-infile = 0\n"
 #endif
 		     "skip-name-resolve\n"
 		     "bind-address = "+env->MYSQL_HOST+"\n" +
-		     (uid ? "user = " + uid : "") + "\n");
+		     (uid ? "user = " + uid : "") + "\n"
+		     "!include "+combine_path(query_configuration_dir(),
+                                 "_mysql_extraoptions")+"\n");
 
 #ifdef __NT__
   cfg_file = replace(cfg_file, "\n", "\r\n");