[debian-mysql] Bug#430684: Bug#430684: Calculating the timeout instead of using a configuration setting.

Monty Taylor mtaylor at mysql.com
Wed Jun 27 17:57:31 UTC 2007


sean finney wrote:
> On Wednesday 27 June 2007 15:52:02 Paul Veldema wrote:
> <snip>
>>     mysql_startup_timeout() {
>>         memtotal="`cat /proc/meminfo | grep MemTotal | cut -d ':' -f 2 |
>> sed 's/ //g' | cut -d 'k' -f 1`"
>>         # 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
>>     }
> 
> neat!  two comments:
> 
> - /proc/meminfo is linux specific and less general.  perhaps you could write 
> something with "free" or some other generic utility instead?
> - 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.

So, I like the idea in general, but unfortunately it's not the only
thing that would cause MySQL to start slowly. If we're talking about
after a crash, you've also got to play the Innodb log files into the
data file or check the MyISAM tables. In some systems, like ones we're
managing with Heartbeat/DRBD for example, you _really_ want to be able
to explicitly say "please, under no circumstances timeout, because I
need a failure or success for real" so that heartbeat doesn't go crazy.
You also want to be checking while looping to see if the process is
still around or if it has died so that you don't have to wait until the
end of the timeout, since it is possible to determine that, in fact,
things have failed already.

> but in any event, i think it's a great idea.  monty: you think this is 
> something mysql.com would be interested in?

I like the checking memory idea. I can see if being useful as a way to
get a default timeout in the case where none has been configured.

I promise, I'll send something RSN. :) I've been trying my best to merge
the MySQL init script and the debian init script, which is made
amazingly hard by the debian extensions to the lsb init script stuff.
(grumble grumble)

Screw it. Here's my not-quite-working attempt so far to make a fully LSB
compliant init script that does all of the things we're talking about
here and also does all of the nice Debian things and returns codes
sensibly enough that heartbeat can use its outputs sensible in a cluster
manager situation. PLEASE help me figure out ways to make it better.
(especially as currently it outputs extra linefeeds and dots that I
don't want it to on debian, I think)
-- 
Monty Taylor
Senior Consultant
MySQL Inc., www.mysql.com
Get More with MySQL!  www.mysql.com/consulting
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql.server.sh
Type: application/x-shellscript
Size: 12027 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20070627/a54dbfac/attachment-0001.bin 


More information about the pkg-mysql-maint mailing list