No subject


Sun May 13 13:41:23 UTC 2007


> - /proc/meminfo is linux specific and less general.  perhaps you could write 
> something with "free" or some other generic utility instead?

Just for fun, here the version using 'free':

    mysql_startup_timeout() {
        memtotal="`free -k | head -2 | tail -1| cut -d ':' -f 2 | tr -s '[:space:]' ' ' | cut -d ' ' -f 2`"
        # round memory royally upward for calc in gigabytes.
        memtotal=`expr $memtotal + 700000`
        timeout=`expr $memtotal  / $MEMORY_ALLOCATION_PER_SEC_IN_KB`
        timeout=`expr $timeout + $TIMEOUT_OFFSET`
        if test $timeout -gt 14; then
            echo $timeout
        else
            echo 14
        fi
    }

I did not integrate this into monty's script in favour of the option of looping
indefinitely (read on).

> - your suggestion isn't mutually exclusive from the previous one i made.  it 
> could be made optional to specify a timeout value, and if not specified, use 
> the heuristic you provide, which would be the default.

Monty's script does that, but gives a realy large default timeout 
instead, that makes me think, is there a case
you would want a timeout at all? Until now I have only seen reasons to 
make the timeout larger.
 From Monty's script:

    # 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

If using a timeout is only for specific cases, I would change the 
default to -1: wait indefinitely unless a
specific timeout setting is given ('do not wait' or give a tight 
timeout). That would solve this issue for any future
machine regardless of memory size or speed.



More information about the pkg-mysql-maint mailing list