2009-10-25から1日間の記事一覧

fork & Parallel::ForkManager

fork 標準関数のfork()の使い方。 use strict; if (my $pid = fork()) { # parent print "here is parent proces.\n"; } elsif ($pid == 0) { # child sleep(3); print "child process ends.\n"; exit 0; } else { die "fork error: $!" } print "parent pro…

MySQL wait_timeoutの挙動

sql

アイドル状態(最後の実行から何もしていない)がN秒続くとMySQLが勝手に接続を切るらしい。 このN秒を設定するのがwait_timeoutである。 まず、デフォルト設定を確認してみる。 mysql -uroot -e'show variables' | egrep '(wait)'; -------- wait_timeout 2…