Aller au contenu

Messages recommandés

Bonjour,

je dépose un message ici pour des questions de lenteur.

En effet, je dispose d'une NAS SYNOLOGY DS207 et j'ai des problème de lenteur lorsque j'accède à mon site internet.

Pour prendre en compte les différents aspects de lenteur,

j'ai cherché à savoir si ça venait du réseau ou de la machine.

Pour cela très simple j'ai installé dans le même réseau une autre machine cette fois sous WAMP avec le même site internet.

Et j'ai remarqué une différence pour :

WAMP : 5,93s

LAMP (DS207) : 15,90s

J'ai essayé d'optimisé le site mais je remarque que j'ai le script de chargement qui prend le plus de temps :

WAMP : 0s (bizarre que ça soit nul)

LAMP (DS207) : 12,21s

Les ressources de Chrome m'indique que c'est du "document" mdrrr

Pour apache, j'ai mis un cache pour les images, HTML, js, css.


vi /usr/syno/apache/conf/httpd.conf

LoadModule expires_module modules/mod_expires.so


<IfModule mod_expires.c>

ExpiresActive on ExpiresDefault "access plus 2 minutes"

ExpiresByType text/html "access plus 120 seconds"

ExpiresByType text/css "access plus 1 month"

ExpiresByType text/javascript "access plus 1 month"

ExpiresByType application/x-javascript "access plus 1 month"

ExpiresByType application/javascript "access plus 1 month"

ExpiresByType image/gif "access plus 1 months"

ExpiresByType image/jpeg "access plus 1 months"

ExpiresByType image/png "access plus 1 months"

</IfModule>


LoadModule deflate_module modules/mod_deflate.so

<IfModule mod_deflate.c>

DeflateCompressionLevel 2

AddOutputFilterByType DEFLATE text/html text/plain text/xml 

text/javascript text/css application/javascript

SetOutputFilter DEFLATE

Header append Vary User-Agent env=!dont-vary

AddOutputFilter DEFLATE js css

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.[0678] no-gzip

BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html

</IfModule>
J'ai limiter l'utilisation de l'administration du nas synology :

vi /usr/syno/apache/conf/httpd.conf-sys

MinSpareServers 1

MaxSpareServers 3


StartServers 1
Et maintenant, j'aimerai optimiser MYSQL :

// Fichier de configuration lors du lancement

vi /usr/syno/mysql/share/mysql/mysql.server

// Une sauvegarde

cp /etc/my.cnf /etc/my.cnf.bkp

// J'ajoute les paramètres d'un fichier par défaut


cp /usr/syno/mysql/share/mysql/my-medium.cnf /etc/my.cnf

chmod 644 /etc/my.cnf
Je test la manipulation suivante :

# cp /usr/syno/mysql/share/mysql/my-medium.cnf /etc/my.cnf

# /usr/syno/etc/rc.d/S21mysql.sh restart

Stopping MySQL...

Shutting down MySQL. SUCCESS! 

Starting MySQL...

Starting MySQL... ERROR! Manager of pid-file quit without updating file.

MYSQL data dir = /volume1/@database/mysql...
Je reviens en arrière :

# cp /etc/my.cnf.bkp /etc/my.cnf                              

# /usr/syno/etc/rc.d/S21mysql.sh restart

Stopping MySQL...

 ERROR! MySQL manager or server PID file could not be found!

Starting MySQL...

Starting MySQL. SUCCESS! 

MYSQL data dir = /volume1/@database/mysql...
Les paramètres MYSQL doivent être uniquement dans le fichier /usr/syno/etc/rc.d/S21mysql.sh puisqu'il n'y à rien dans le fichier /etc/my.cnf

#!/bin/sh

PID_FILE=/tmp/mysqld.pid

MYSQL_VERSION="5.1.34"

MYSQL_DIR="/usr/syno/mysql"

MYSQL_SERVICE_PATH="/var/services/mysql"

DO_NETBKP_CANCEL_TMP_FILE="/tmp/do_netbkp_cancel.chk"

LOCALBKP_CANCEL_TMP_FILE="/tmp/do_localbkp_cancel.chk"

MYSQL_RCVR_DB_CONFLICT_LIST="/tmp/mysql_rcvr_db_conflict_list.tmp"

MYSQL_RCVR_DB_NEW_LIST="/tmp/mysql_rcvr_db_new_list.tmp"

MYSQL_FAIL=1

CANCEL_RET=2

MYSQL_PROG_PATH=/usr/syno/mysql/bin/mysql


MYSQL_ARGS="--max_allowed_packet=8M"


UpgradeDatabase()

{

	# Upgrade MySQL database

	Ret=0


	# Backup root password and reset password to empty

	echo "USE mysql;" > /tmp/mysql_init.$$

	echo "DELETE FROM user WHERE user='upgrade_root_tmp';" >> /tmp/mysql_init.$$

	echo "UPDATE user SET user='upgrade_root_tmp' WHERE user='root';" >> /tmp/mysql_init.$$

	echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;" >> /tmp/mysql_init.$$

	echo "FLUSH PRIVILEGES;" >> /tmp/mysql_init.$$

	${MYSQL_DIR}/bin/mysqld_safe --init-file=/tmp/mysql_init.$$ --pid-file=${PID_FILE} &

	sleep 20


	# Start Upgrade

	/usr/syno/mysql/bin/mysql_upgrade

	Ret=$?

	$0 stop

	rm /tmp/mysql_init.$$

	sleep 3


	# Restore root password

	echo "USE mysql;" > /tmp/mysql_init.$$

	echo "DELETE FROM user WHERE user='root';" >> /tmp/mysql_init.$$

	echo "UPDATE user SET user='root' WHERE user='upgrade_root_tmp';" >> /tmp/mysql_init.$$

	${MYSQL_DIR}/bin/mysqld_safe --init-file=/tmp/mysql_init.$$ --pid-file=${PID_FILE} &

	sleep 20

	$0 stop

	rm /tmp/mysql_init.$$

	sleep 3


	return $Ret

}


CheckCancellingAction()

{

	Ret=0;


	# check if user has canceld the backup task

	if [ $1 = "netbkp" ]; then

		if [ -f "${DO_NETBKP_CANCEL_TMP_FILE}" ]; then

			Ret=${CANCEL_RET}

		fi

	elif [ $1 = "localbkp" ]; then

		if [ -f "${LOCALBKP_CANCEL_TMP_FILE}" ]; then

			Ret=${CANCEL_RET}

		fi

	else

		Ret=${MYSQL_FAIL}

	fi


	return $Ret

}


BackupDatabase()

{

	# Dump MySQL database

	Ret=0

	DST_PATH=$1

	BKPTYPE=$2


	# Start dump

	for i in `find /var/services/mysql/* -type d` 

	do

		# check if user has canceld the backup task

		CheckCancellingAction ${BKPTYPE}

		Ret=$?

		if [ ${Ret} -ne 0 ]; then

			return ${Ret}

		fi


		f=`basename ${i}`

		f_tmp=`echo $f | sed -e 's/@00/\\\\x/g'`		

		f_tmp=`echo -e "$f_tmp"`		

		# skip mysql and test databases

		if [ "${f_tmp}" = "mysql" -o "${f_tmp}" = "test" ]; then

			continue

		fi


		# dump database

		rm -f "$DST_PATH/${f}.sql"

		/usr/syno/mysql/bin/mysqldump --database "${f_tmp}" > "$DST_PATH/${f}.sql"


		# If fail to dump, return ${MYSQL_FAIL}

		if [ $? -ne 0 ]; then

			return ${MYSQL_FAIL}

		fi


		# check if user has canceld the backup task before excuting gzip command

		CheckCancellingAction ${BKPTYPE}

		Ret=$?

		if [ ${Ret} -ne 0 ]; then

			return ${Ret}

		fi


		rm -f "$DST_PATH/${f}.sql.gz"

		gzip -f  "$DST_PATH/${f}.sql"

	done


	return $Ret

}


TablesSet()

{

	db="$1"

	ext=$2

	set_type=$3


	`echo "use '${db}'; show tables;" | ${MYSQL_PROG_PATH} > /tmp/table_list.${ext}` 

	cat /tmp/table_list.${ext} | while read line

	do

		if [ "${line}" = "Tables_in_${db}" ]; then

			continue;

		fi

		if [ ${set_type} = "rename" ]; then

			echo "use '${db}'; rename table \`${line}\` to \`${line}_${ext}\`;" | ${MYSQL_PROG_PATH}

		elif [ ${set_type} = "recover" ]; then

			ori_table=${line%_${ext}}

			echo "use '${db}'; rename table \`${line}\` to \`${ori_table}\`;" | ${MYSQL_PROG_PATH}

		elif [ ${set_type} = "drop_ori" ]; then

			# check if ${line} is the original table

			echo "${line}" | grep -q "_${ext}"

			if [ $? -eq 0 ]; then

				echo "use '${db}'; drop table \`${line}\`;" | ${MYSQL_PROG_PATH}

			fi

		elif [ ${set_type} = "drop_new" ]; then

			# check if ${line} is the original table

			echo "${line}" | grep -q "_${ext}"

			if [ $? -eq 0 ]; then

				continue;

			fi

			echo "use '${db}'; drop table \`${line}\`;" | ${MYSQL_PROG_PATH}

		fi

	done

	rm /tmp/table_list.${ext} 

}


RestoreDatabase()

{

	# Dump MySQL database

	Ret=0

	OVERWRITE_DB=${2}


	# MySQL database has not been enabled.

	if [ ! -d "${MYSQL_SERVICE_PATH}" ]; then

		return ${MYSQL_FAIL}

	fi


	time=`date +%s`

	RESTORE_RET=0

	echo -n > ${MYSQL_RCVR_DB_CONFLICT_LIST}

	echo -n > ${MYSQL_RCVR_DB_NEW_LIST}

        echo $1

	for i in `find "$1"/*.sql.gz -type f`

	do

		DB_NAME=`basename "$i"`

                DB_NAME=${DB_NAME%.sql.gz}


		DB_NAME_TMP=`echo $DB_NAME | sed -e 's/@00/\\\\x/g'`

		DB_NAME_TMP=`echo -e "$DB_NAME_TMP"` 

		# if database is conflict, need to rename its tables

		if [ -d "${MYSQL_SERVICE_PATH}/${DB_NAME}" ]; then

			if [ ${OVERWRITE_DB} = "yes" ]; then

				TablesSet "${DB_NAME_TMP}" ${time} "rename"

				# record conflict restored db to temp file

				echo "${DB_NAME_TMP}" >> ${MYSQL_RCVR_DB_CONFLICT_LIST}

			else

				continue;

			fi

		else

			# record new restored db to temp file

			echo "${DB_NAME_TMP}" >> ${MYSQL_RCVR_DB_NEW_LIST}

		fi


		gunzip -c "$1/${DB_NAME}.sql.gz" | ${MYSQL_PROG_PATH}


		# check if database is restored sucessfully

		if [ $? -ne 0 ]; then

			Ret=${MYSQL_FAIL};

			break;

		fi

	done


	# Check If the restoration task is successful, 

	# If failed, drop all new database and recover all tables in all conflict databases

	# If successful, drop all original tables in all conflct databases

	if [ ${Ret} -eq 0 ]; then

		# drop all original tables

		cat ${MYSQL_RCVR_DB_CONFLICT_LIST} | while read line

		do

			TablesSet "${line}" ${time} "drop_ori"

		done

	else

		# drop all new databases

		cat ${MYSQL_RCVR_DB_NEW_LIST} | while read line

		do

			echo "drop database ${line}" | /usr/syno/mysql/bin/msyql

		done


		cat ${MYSQL_RCVR_DB_CONFLICT_LIST} | while read line

		do

			TablesSet "${line}" ${time} "drop_new"

			TablesSet "${line}" ${time} "recover"

		done

	fi


	rm -f ${MYSQL_RCVR_DB_CONFLICT_LIST}

	rm -f ${MYSQL_RCVR_DB_NEW_LIST}


	return $Ret

}


case $1 in

	start)

		RunMySQL=`/bin/get_key_value /etc/synoinfo.conf runmysql`

		case "$RunMySQL" in

		[Yy][Ee][Ss])

			;;

		*)

			echo "MySQL is not enabled. Skip..."

			exit;

			;;

		esac


		VolHome=`/usr/syno/bin/servicetool --get-service-volume mysql`

		ServiceOnVolume=$?

		if [ ${ServiceOnVolume} -eq 0 ]; then

			echo "Let User to choose where to set MySQL..."

			exit;

		fi


		DataDir=${VolHome}/@database

		NeedUpgrade=1

		if [ ! -d ${DataDir}/mysql ]; then

			echo "Initialize MySQL..."

			mkdir $DataDir

			chown admin $DataDir

			su -l admin -c "/usr/syno/mysql/bin/mysql_install_db --datadir=${DataDir}/mysql --force"

			echo $MYSQL_VERSION > ${DataDir}/mysql/VERSION

			NeedUpgrade=0

		elif [ -f ${DataDir}/mysql/VERSION ]; then

			grep $MYSQL_VERSION ${DataDir}/mysql/VERSION > /dev/null 2>&1

			if [ $? -eq 0 ]; then

				NeedUpgrade=0

			fi

		fi

		if [ $NeedUpgrade -eq 1 ]; then

			echo "Need to upgrade MySQL database. Starting..."

			UpgradeDatabase

			if [ $? -eq 0 ]; then

				echo $MYSQL_VERSION > ${DataDir}/mysql/VERSION

			fi

		fi


		echo "Starting MySQL..."

		${MYSQL_DIR}/share/mysql/mysql.server start --datadir=${DataDir}/mysql --pid-file=${PID_FILE} ${MYSQL_ARGS}

		echo "MYSQL data dir = ${DataDir}/mysql..."

		;;

	stop)

		echo "Stopping MySQL..."

		${MYSQL_DIR}/share/mysql/mysql.server stop --pid-file=${PID_FILE}

		;;

	restart)

		$0 stop

		sleep 1

		$0 start

		;;

	resetpassword)

		$0 stop

		sleep 3

		echo "use mysql;" >/tmp/mysql_init.$$

		echo "DELETE FROM user WHERE user='root';" >> /tmp/mysql_init.$$

		echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;" >> /tmp/mysql_init.$$

		${MYSQL_DIR}/bin/mysqld_safe --init-file=/tmp/mysql_init.$$ --pid-file=${PID_FILE} &

		sleep 20

		$0 stop

		rm /tmp/mysql_init.$$

		sleep 3

		;;

	backupdb)

		if [ -z "$2" -o -z "$3" ]; then

			echo "Usage: $1 backupdb destination_path backup_type[netbkp|localbkp]"

			return ${MYSQL_FAIL}

		fi

		BackupDatabase "$2" $3

		Ret=$?

		return $Ret

		;;

	restoredb)

		if [ -z "$2" -o -z "$3" ]; then

			echo "Usage: $1 restoredb source_path overwrite[yes|no]"

			return ${MYSQL_FAIL}

		fi

		RestoreDatabase "$2" $3

		Ret=$?

		return $Ret

		;;

	*)

		echo "Usage: $0 start|stop|backupdb|restoredb"

		;;

esac

Comment optimiser MYSQL sur le NAS DS207?

sources :

http://dev.mysql.com...tion-files.html

http://www.t-scripts.com/mysql/

http://www.geekwisdo.../cache-control1

Lien vers le commentaire
Partager sur d’autres sites

Le lancement de mysql se joue avec cette commande :

PID_FILE=/tmp/mysqld.pid

MYSQL_ARGS="--max_allowed_packet=8M"

${MYSQL_DIR}/share/mysql/mysql.server start --datadir=${DataDir}/mysql --pid-file=${PID_FILE} ${MYSQL_ARGS}
vi /usr/syno/mysql/share/mysql/mysql.server
#!/bin/sh

# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB

# This file is public domain and comes with NO WARRANTY of any kind


# MySQL daemon start/stop script.


# Usually this is put in /etc/init.d (at least on machines SYSV R4 based

# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.

# When this is done the mysql server will be started when the machine is

# started and shut down when the systems goes down.


# Comments to support chkconfig on RedHat Linux

# chkconfig: 2345 64 36

# description: A very fast and reliable SQL database engine.


# Comments to support LSB init script conventions

### BEGIN INIT INFO

# Provides: mysql

# Required-Start: $local_fs $network $remote_fs

# Should-Start: ypbind nscd ldap ntpd xntpd

# Required-Stop: $local_fs $network $remote_fs

# Default-Start:  2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: start and stop MySQL

# Description: MySQL is a very fast and reliable SQL database engine.

### END INIT INFO


# If you install MySQL on some other places than /usr/syno/mysql, then you

# have to do one of the following things for this script to work:

#

# - Run this script from within the MySQL installation directory

# - Create a /etc/my.cnf file with the following information:

#   [mysqld]

#   basedir=<path-to-mysql-installation-directory>

# - Add the above to any other configuration file (for example ~/.my.ini)

#   and copy my_print_defaults to /usr/bin

# - Add the path to the mysql-installation-directory to the basedir variable

#   below.

#

# If you want to affect other MySQL variables, you should make your changes

# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.


# If you change base dir, you must also change datadir. These may get

# overwritten by settings in the MySQL configuration files.


basedir=

datadir=


# Default value, in seconds, afterwhich the script should timeout waiting

# for server start. 

# Value here is overriden by value in my.cnf. 

# 0 means don't wait at all

# Negative numbers mean to wait indefinitely

service_startup_timeout=900


# The following variables are only set for letting mysql.server find things.


# Set some defaults

pid_file=

server_pid_file=

use_mysqld_safe=1

user=admin

if test -z "$basedir"

then

  basedir=/usr/syno/mysql

  bindir=/usr/syno/mysql/bin

  if test -z "$datadir"

  then

    datadir=/var/services/mysql

  fi

  sbindir=/usr/syno/mysql/sbin

  libexecdir=/usr/syno/mysql/libexec

else

  bindir="$basedir/bin"

  if test -z "$datadir"

  then

    datadir="$basedir/data"

  fi

  sbindir="$basedir/sbin"

  libexecdir="$basedir/libexec"

fi


# datadir_set is used to determine if datadir was set (and so should be

# *not* set inside of the --basedir= handler.)

datadir_set=


#

# Use LSB init script functions for printing messages, if possible

#

lsb_functions="/lib/lsb/init-functions"

if test -f $lsb_functions ; then

  . $lsb_functions

else

  log_success_msg()

  {

    echo " SUCCESS! $@"

  }

  log_failure_msg()

  {

    echo " ERROR! $@"

  }

fi


PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin

export PATH


mode=$1    # start or stop

shift

other_args="$*"   # uncommon, but needed when called from an RPM upgrade action

   		# Expected: "--skip-networking --skip-grant-tables"

   		# They are not checked here, intentionally, as it is the resposibility

   		# of the "spec" file author to give correct arguments only.


case `echo "testing\c"`,`echo -n testing` in

    *c*,-n*) echo_n=   echo_c= 	;;

    *c*,*)   echo_n=-n echo_c= 	;;

    *)   	echo_n=   echo_c='\c' ;;

esac


parse_server_arguments() {

  for arg do

    case "$arg" in

      --basedir=*)  basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`

                    bindir="$basedir/bin"

    		if test -z "$datadir_set"; then

      		datadir="$basedir/data"

    		fi

    		sbindir="$basedir/sbin"

    		libexecdir="$basedir/libexec"

        ;;

      --datadir=*)  datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`

    		datadir_set=1

	;;

      --user=*)  user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

      --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

      --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

      --use-mysqld_safe) use_mysqld_safe=1;;

      --use-manager) 	use_mysqld_safe=0;;

    esac

  done

}


parse_manager_arguments() {

  for arg do

    case "$arg" in

      --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

      --user=*)  user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

    esac

  done

}


wait_for_pid () {

  verb="$1"

  manager_pid="$2"  # process ID of the program operating on the pid-file

  i=0

  avoid_race_condition="by checking again"

  while test $i -ne $service_startup_timeout ; do


    case "$verb" in

      'created')

        # wait for a PID-file to pop into existence.

        test -s $pid_file && i='' && break

        ;;

      'removed')

        # wait for this PID-file to disappear

        test ! -s $pid_file && i='' && break

        ;;

      *)

        echo "wait_for_pid () usage: wait_for_pid created|removed manager_pid"

        exit 1

        ;;

    esac


    # if manager isn't running, then pid-file will never be updated

    if test -n "$manager_pid"; then

      if kill -0 "$manager_pid" 2>/dev/null; then

        :  # the manager still runs

      else

        # The manager may have exited between the last pid-file check and now.  

        if test -n "$avoid_race_condition"; then

          avoid_race_condition=""

          continue  # Check again.

        fi


        # there's nothing that will affect the file.

        log_failure_msg "Manager of pid-file quit without updating file."

        return 1  # not waiting any more.

      fi

    fi


    echo $echo_n ".$echo_c"

    i=`expr $i + 1`

    sleep 1

  done


  if test -z "$i" ; then

    log_success_msg

    return 0

  else

    log_failure_msg

    return 1

  fi

}


# Get arguments from the my.cnf file,

# the only group, which is read from now on is [mysqld]

if test -x ./bin/my_print_defaults

then

  print_defaults="./bin/my_print_defaults"

elif test -x $bindir/my_print_defaults

then

  print_defaults="$bindir/my_print_defaults"

elif test -x $bindir/mysql_print_defaults

then

  print_defaults="$bindir/mysql_print_defaults"

else

  # Try to find basedir in /etc/my.cnf

  conf=/etc/my.cnf

  print_defaults=

  if test -r $conf

  then

    subpat='^[^=]*basedir[^=]*=\(.*\)

    dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`

    for d in $dirs

    do

      d=`echo $d | sed -e 's/[ 	]//g'`

      if test -x "$d/bin/my_print_defaults"

      then

        print_defaults="$d/bin/my_print_defaults"

        break

      fi

      if test -x "$d/bin/mysql_print_defaults"

      then

        print_defaults="$d/bin/mysql_print_defaults"

        break

      fi

    done

  fi


  # Hope it's in the PATH ... but I doubt it

  test -z "$print_defaults" && print_defaults="my_print_defaults"

fi


#

# Read defaults file from 'basedir'.   If there is no defaults file there

# check if it's in the old (depricated) place (datadir) and read it from there

#


extra_args=""

if test -r "$basedir/my.cnf"

then

  extra_args="-e $basedir/my.cnf"

else

  if test -r "$datadir/my.cnf"

  then

    extra_args="-e $datadir/my.cnf"

  fi

fi


parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server` $@


# Look for the pidfile 

parse_manager_arguments `$print_defaults $extra_args manager`


#

# Set pid file if not given

#

if test -z "$pid_file"

then

  pid_file=$datadir/mysqlmanager-`/bin/hostname`.pid

else

  case "$pid_file" in

    /* ) ;;

    * )  pid_file="$datadir/$pid_file" ;;

  esac

fi

if test -z "$server_pid_file"

then

  server_pid_file=$datadir/`/bin/hostname`.pid

else

  case "$server_pid_file" in

    /* ) ;;

    * )  server_pid_file="$datadir/$server_pid_file" ;;

  esac

fi


case "$mode" in

  'start')

    # Start daemon


    # Safeguard (relative paths, core dumps..)

    cd $basedir


    manager=$bindir/mysqlmanager

    if test -x $libexecdir/mysqlmanager

    then

      manager=$libexecdir/mysqlmanager

    elif test -x $sbindir/mysqlmanager

    then

      manager=$sbindir/mysqlmanager

    fi


    echo $echo_n "Starting MySQL"

    if test -x $manager -a "$use_mysqld_safe" = "0"

    then

      if test -n "$other_args"

      then

        log_failure_msg "MySQL manager does not support options '$other_args'"

        exit 1

      fi

      # Give extra arguments to mysqld with the my.cnf file. This script may

      # be overwritten at next upgrade.

      "$manager" \

        --mysqld-safe-compatible \

        --user="$user" \

        --pid-file="$pid_file" >/dev/null 2>&1 &

      wait_for_pid created $!; return_value=$?


      # Make lock for RedHat / SuSE

      if test -w /var/lock/subsys

      then

        touch /var/lock/subsys/mysqlmanager

      fi

      exit $return_value

    elif test -x $bindir/mysqld_safe

    then

      # Give extra arguments to mysqld with the my.cnf file. This script

      # may be overwritten at next upgrade.

      pid_file=$server_pid_file

      $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &

      wait_for_pid created $!; return_value=$?


      # Make lock for RedHat / SuSE

      if test -w /var/lock/subsys

      then

        touch /var/lock/subsys/mysql

      fi

      exit $return_value

    else

      log_failure_msg "Couldn't find MySQL manager ($manager) or server ($bindir/mysqld_safe)"

    fi

    ;;


  'stop')

    # Stop daemon. We use a signal here to avoid having to know the

    # root password.


    # The RedHat / SuSE lock directory to remove

    lock_dir=/var/lock/subsys/mysqlmanager


    # If the manager pid_file doesn't exist, try the server's

    if test ! -s "$pid_file"

    then

      pid_file=$server_pid_file

      lock_dir=/var/lock/subsys/mysql

    fi


    if test -s "$pid_file"

    then

      mysqlmanager_pid=`cat $pid_file`

      echo $echo_n "Shutting down MySQL"

      kill $mysqlmanager_pid

      # mysqlmanager should remove the pid_file when it exits, so wait for it.

      wait_for_pid removed "$mysqlmanager_pid"; return_value=$?


      # delete lock for RedHat / SuSE

      if test -f $lock_dir

      then

        rm -f $lock_dir

      fi

      exit $return_value

    else

      log_failure_msg "MySQL manager or server PID file could not be found!"

    fi

    ;;


  'restart')

    # Stop the service and regardless of whether it was

    # running or not, start it again.

    if $0 stop  $other_args; then

      $0 start $other_args

    else

      log_failure_msg "Failed to stop running server, so refusing to try to start."

      exit 1

    fi

    ;;


  'reload'|'force-reload')

    if test -s "$server_pid_file" ; then

      read mysqld_pid <  $server_pid_file

      kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"

      touch $server_pid_file

    else

      log_failure_msg "MySQL PID file could not be found!"

      exit 1

    fi

    ;;

  'status')

    # First, check to see if pid file exists

    if test -s "$server_pid_file" ; then 

      read mysqld_pid < $server_pid_file

      if kill -0 $mysqld_pid 2>/dev/null ; then 

        log_success_msg "MySQL running ($mysqld_pid)"

        exit 0

      else

        log_failure_msg "MySQL is not running, but PID file exists"

        exit 1

      fi

    else

      # Try to find appropriate mysqld process

      mysqld_pid=`pidof $libexecdir/mysqld`

      if test -z $mysqld_pid ; then 

        if test "$use_mysqld_safe" = "0" ; then 

          lockfile=/var/lock/subsys/mysqlmanager

        else

          lockfile=/var/lock/subsys/mysql

        fi 

        if test -f $lockfile ; then 

          log_failure_msg "MySQL is not running, but lock exists"

          exit 2

        fi 

        log_failure_msg "MySQL is not running"

        exit 3

      else

        log_failure_msg "MySQL is running but PID file could not be found"

        exit 4

      fi

    fi

    ;;

    *)

      # usage

      echo "Usage: $0  {start|stop|restart|reload|force-reload|status}  [ MySQL server options ]"

      exit 1

    ;;

esac


exit 0

Lien vers le commentaire
Partager sur d’autres sites

Il sert a quoi ton dernier post a part a publier le fichier "mysql.server" ??

Tu attends quoi exactement comme réponse !!??

Patrick

Bonjour Patrick,

Crois tu normal qu'il faut 10s de plus au NAS pour charger une page banale?

Mon dernier post sert à montrer mon avancement et savoir où sont les paramètres qui serviront à améliorer MYSQL.

Le service LAMP du NAS est considérablement lent, pourquoi?

La seule réponse que j'ai entendu de ta part, c'est que l'on ne peut pas comparer 2 machines de puissances différentes.

Or 10 secondes, c'est tout de même énorme, tu penses pas qu'il pourrait avoir une optimisation à faire?

Ou crois-tu qu'il faut changer de machine car la seule et unique solution que tu as à apporter est la puissance machine?

Cdlt

Lien vers le commentaire
Partager sur d’autres sites

Quand tu parles du DS207 je sais exactement de quoi tu parles, quand tu parles de la page

Lien vers le commentaire
Partager sur d’autres sites

Hello,

Moi je rejoins patrickH et romain 74960, Tu ne peux pas du tout comparé les 2. et pour moi 10sec c'est pas énorme.

Pour ma part j'ai un Gros site sous joomla et rien du faite de passé d'un 207+ a un 209+ j'ai bien gagné au moins 4SEC

pourtant la différence entre les 2 machine (sans rentré dans les détails) sont 300Mhz et 384Mo de ram

alors 10sec de différence entre un proc a 266Mhz et un autre surement a plus de 1Ghz + au moins 1Go de ram, je trouve pas ça énorme.

Après sincèrement nous mettre des tartine de code qui sont 'inutile' ne changera pas la réponse que l'on t'apportera.

Cordialement,

Lien vers le commentaire
Partager sur d’autres sites

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Répondre à ce sujet…

×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

  Seulement 75 émoticônes maximum sont autorisées.

×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

×   Votre contenu précédent a été rétabli.   Vider l’éditeur

×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.