SMF Support > Server Performance and Configuration

Something like mtop, but showing whole sql sentences in action?

<< < (2/2)

CoreISP:

--- Code: ---mysql show processlist\G

--- End code ---

butch2k:
Show processlist is not of much use since you can only catch long running queries, those lasting a fraction of second won't be catched unless you are very lucky.

luuuciano:

--- Quote from: butch2k on March 05, 2012, 09:42:44 AM --- :o :o :o :o
Definitely wrong indeed !!!!
The log-bin is not a log per se but used for replication purposes, you should put the options back to standard value asap !

The two values on interest for you are those related to general-query-log:
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_general_log


--- End quote ---

Thanks, done :)

btw, this is the mysqld start script (on an archlinux distribution)

--- Code: ---#!/bin/bash

# general config
. /etc/rc.conf
. /etc/rc.d/functions

getPID() {
   echo $(pgrep -u mysql mysqld 2>/dev/null);
}

case "$1" in
  start)
    stat_busy "Starting MySQL Server"
    [ ! -d /var/run/mysqld  ] && install -d -g mysql -o mysql /var/run/mysqld &>/dev/null
    if [ -z "$(getPID)" ]; then
       /usr/bin/mysqld_safe --user=mysql -l &>/dev/null &
      if [ $? -gt 0 ]; then
        stat_fail
        exit 1
      else
        timeo=30
        while [ $timeo -gt 0 ]; do
          response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break
          echo "$response" | grep -q "mysqld is alive" && break
          sleep 1
          let timeo=${timeo}-1
        done
        if [ $timeo -eq 0 ]; then
          stat_fail
          exit 1
        else
          echo $(getPID) > /var/run/mysqld/mysqld.pid
          add_daemon mysqld
          stat_done
        fi
      fi
    else
      stat_fail
      exit 1
    fi
    ;;

  stop)
    stat_busy "Stopping MySQL Server"
    if [ ! -z "$(getPID)" ]; then
      timeo=30
      kill $(getPID) &> /dev/null
      if [ $? -gt 0 ]; then
        stat_fail
        exit 1
      fi
      while [ ! -z "$(getPID)" -a $timeo -gt 0 ]; do
        sleep 1
        let timeo=${timeo}-1
      done
      if [ -z "$(getPID)" ]; then
        rm -f /var/run/mysqld/mysqld.pid &>/dev/null
        rm_daemon mysqld
        stat_done
      else
        stat_fail
        exit 1
      fi
    else
      stat_fail
      exit 1
    fi
    ;;

  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0
--- End code ---

Where should I add --general-log? (temporally)


EDIT: here http://www.simplemachines.org/community/index.php?topic=451804.msg3287653#msg3287653 feline found the guilty sql query :)

lemmy28:
help me webhost says my    /usr/bin/php /home/lemmy28/public_html/index.php is eating too many resources that they might suspend me what could be the cause of this

luuuciano:
Wich is your hosting? too cheap? your forum is visited/used a lot?

Search the thread about doing things to decrease the cpu usage on a smf forum

Navigation

[0] Message Index

[*] Previous page

Go to full version