精華區beta Linux 關於我們 聯絡資訊
==> 在 tbsky@cis_nctu (sky) 的文章中提到: 大家好,我是裝了五台 linux server 結果三台不穩的可憐人... 經過一番努力,解決了其中兩台的問題 (都是 ram 不穩,一條 是 panasonic 的,一條是 lgs 的,夠倒霉)... 但是還有一台經過多次嘗試仍無法解決。ram 也換過了說, 換過之後有稍微好轉,但傳了 24 GB 的資料後依然 fail :( 現在冒著被 K 的危險把 server down 下來測試 (因為我們的 file server 是 24 小時都有人在用的)。主要是又再度開始 懷疑 linux..哎... 我們的 server 裝了三張網路卡,每張都有一個 ip ,其中 第二張還跑 ipx,跑 mars_nwe 模擬 novell。之前我有懷疑 過是 mars_nwe 的關係,不過因為其他網路卡上的資料也會 fail ,所以就忽略了這個念頭,可是現在情況好像越來越明顯,剛剛 第二張網路卡上跑的 ip 資料,幾乎不到 50 mb 就會錯..... 所以好像 linux kernel 的 ip 和 ipx 一起用的時候會有問題?? 第一張網路卡雖然沒跑 ipx ,但因為 kernel 要處理第二張網路卡 的 ipx 資料,使得第一張網路卡的 ip 資料也錯了.... 現在把 mars_nwe 停掉,ipx 從 kernel 拿掉之後,正進行傳檔測試 ...已經超過 3gb 沒有 fail 了.... 這難道真的是 linux 的 bug 嘛?有沒有人也有用 mars_nwe 或者 願意裝一個來試試看的呢? 我被這個問題搞了三個禮拜,偏偏 server 的資料已經大到無法裝在 其他台測試。而且我們是 24 小時使用的.. :( 就這樣走上了 linux 的不歸路................... 我把 script 改正了一下,其實拿來測系統穩定度也不錯啦.... 如果 64 mb ram, 請用 -b20 比較容易抓到問題 如果 256 mb ram, 請用 -b80 比較容易抓到問題 可用 -r0 -q -x 讓它測一整個晚上... script 在這裡..嗚嗚... 用 -ftp 可以免除 telnet 努力測試中.... #!/usr/bin/perl -w # by tbsky for testing ftp $helpmsg = <<TBSKYXJF usage: testftp.pl -u username -p password [-s dir] [-h host] [-d dir] [...] -u username : user id for ftp and telnet -p password : user password for ftp and telnet -s dir : local source directory contain testing files. default /tmp -h host : remote host. default 127.0.0.1 -d dir : remote destination directory. default /tmp/testftp -b bytes : testing file mega bytes. default 20 mega -f files : total testing files. default 20 files -c count : transfer file numbers. default 1 time for each testing file -r round : transfer round. default 5 cycles. 0 means infinite -ftp : use only ftp to check(upload then download), no telnet -q : quiet. only show useful information -qq : more quiet. only show results -x : if got error, exit immediately example1: testftp.pl -u guest -p guest example2: testftp.pl -u guest -p guest -h server example3: testftp.pl -u guest -p guest -s /home/test -d /tmp/test -b30 -r10 TBSKYXJF ; $argv=join(" ",@ARGV); ($user) = $argv =~ /-u\s*(\S+)/; ($passwd) = $argv =~ /-p\s*(\S+)/; ($local) = $argv =~ /-s\s*(\S+)/; ($host) = $argv =~ /-h\s*(\S+)/; ($remote) = $argv =~ /-d\s*(\S+)/; ($byte) = $argv =~ /-b\s*(\d+)/; ($file) = $argv =~ /-f\s*(\d+)/; ($count) = $argv =~ /-c\s*(\d+)/; ($round) = $argv =~ /-r\s*(\d+)\b/; $infinite = $argv =~ /-r\s*0\b/; $ftp = $argv =~ /\s+-ftp\b/; $quiet = 0; $quiet = 1 if ($argv =~ /\s+-q\b/); $quiet = 2 if ($argv =~ /\s+-qq/); $exit = $argv =~ /\s+-x\b/; chomp($expect = `which expect`); chomp($md5sum = `which md5sum`); # testing environment if ( (! defined($user)) || (! defined($passwd)) ){ print $helpmsg ; exit(1); } if (! -e $expect){ print "can not find expect\n" ; exit(1); } if (! -e $md5sum){ print "can not find md5sum\n"; exit(1); } # set variable $local = defined($local) ? $local : "/tmp"; $host = defined($host) ? $host : "127.0.0.1" ; $remote = defined($remote) ? $remote : "/tmp/testftp" ; $byte = $byte ? $byte : 20 ; $file = $file ? $file : 20 ; $count = $count ? $count : 1 ; $round = $round ? $round : 5 ; # creat testing file mkdir($local,0755) || die("can not makedir $local") if (! -e "$local"); $|=1; srand(); print "now make testing file. please wait... " if ($quiet < 2); open(TEST,"> $local/testftp.dat.0") || die("can not write to testftp.dat.0"); $back_length = 0; $size = $byte * 10000 + 1; for ($i=0; $i < 100 ;$i++){ $clear = "\b" x $back_length; print $clear,$i+1,"%" if ($quiet < 2); $back_length = length($i+1) + 1; for ($j=1 ; $j < $size ; $j++){ print TEST chr(int(rand(256))); } } close(TEST); $back_length = 0; print "\nnow copy testing file. please wait... " if ($quiet < 2); for ($i=1; $i < $file; $i++){ $j = $i - 1 ; $k = $i + 1 ; $clear = "\b" x $back_length; print $clear,"$k/$file" if ($quiet < 2) ; $back_length = length("$k/$file"); system("cp $local/testftp.dat.$j $local/testftp.dat.$i"); if ($?){ print "can not copy testing files. disk full?\n"; exit(1); } } $| = 0; $int = 0; $SIG{INT} = 'MY_SIG_INT'; $sum = GETSUM("$local/testftp.dat.0","$local/testftp.sum"); exit(1) if ($int); print "\n$sum standard md5sum...\n" if ($quiet < 2); @urate=(); @drate=(); @error=(); @error_sum = (); CYCLE: for ($time=0; $time < $round || $infinite; $time++){ $r_now = $time + 1; ### upload testing files $elapse = time(); @cmd=("mkdir $remote"); for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ push(@cmd,"put $local/testftp.dat.$j $remote/testftp.$i.$j"); } } FTP(@cmd); last CYCLE if ($int); # count upload rate $elapse = time() - $elapse ; $elapse = $elapse ? $elapse : 1 ; $urate[$time] = 1000 * $byte * $count * $file / $elapse ; if ($ftp){ #download files $elapse = time(); @cmd=(); for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ push(@cmd,"get $remote/testftp.$i.$j $local/testftp.$i.$j"); } } FTP(@cmd); last CYCLE if ($int); # count download rate $elapse = time() - $elapse ; $elapse = $elapse ? $elapse : 1 ; $drate[$time] = 1000 * $byte * $count * $file / $elapse ; $error[$time] = 0 ; $error_sum[$time] = 0 ; # check md5sum for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ $testsum = GETSUM("$local/testftp.$i.$j","$local/testftp.sum"); last CYCLE if ($int); if ($quiet < 2){ print "$testsum $local/testftp.$i.$j round $r_now\n" ; } if ($testsum ne $sum){ if ($exit){ print "md5sum error !!!\n"; print "$sum standard md5sum\n"; print "$testsum $local/testftp.$i.$j round $r_now\n"; exit(1); } $error[$time]++; ## recheck the md5sum $resum = GETSUM("$local/testftp.$i.$j","$local/testftp.sum"); last CYCLE if ($int); if ($quiet < 2){ print "resum: $resum $local/testftp.$i.$j round $r_now\n"; } if ($testsum ne $resum){ $error_sum[$time]++; if ($resum eq $sum){ print "resum is correct !!!\n" if ($quiet < 2); $error[$time]--; } } } } } # erase download files for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ unlink("$local/testftp.$i.$j"); } } # erase remote files @cmd=(); for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ push(@cmd,"del $remote/testftp.$i.$j"); } } push(@cmd,"rmdir $remote"); FTP(@cmd); last CYCLE if ($int); }else{ ### use telnet to count checksum @cmd = ("cat /dev/null > $remote/testftp.sum"); for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ push(@cmd,"md5sum $remote/testftp.$i.$j >>$remote/testftp.sum"); } } TELNET(@cmd); last CYCLE if ($int); ### get md5sum back FTP("get $remote/testftp.sum $local/testftp.sum"); last CYCLE if ($int); ### checking md5sum open(FILE,"$local/testftp.sum"); chomp(@sum=<FILE>); close(FILE); map {print "$_ round $r_now\n"} @sum if ($quiet < 2); $error[$time] = 0 ; $error_sum[$time] = 0 ; for ($i=0; $i < $count * $file; $i++){ last CYCLE if ($int); ($testsum,$testfile)= $sum[$i] =~ /^(\S+)\s+(\S+)/; if ($testsum ne $sum){ if ($exit){ print "md5sum error !!!\n"; print "$sum standard md5sum\n"; print "$testsum $host:/$remote/$testfile round $r_now\n"; exit(1); } $error[$time]++; ## recheck the md5sum TELNET("md5sum $testfile >$remote/testftp.resum"); last CYCLE if ($int); FTP("get $remote/testftp.resum $local/testftp.resum"); last CYCLE if ($int); open(FILE,"$local/testftp.resum"); @resum=<FILE>; close(FILE); print "resum: ",@resum if ($quiet < 2); ($resum) = $resum[0] =~ /^(\S+)/; if ($testsum ne $resum){ $error_sum[$time]++; if ($resum eq $sum){ print "resum is correct !!!\n" if ($quiet < 2); $error[$time]--; } } } } ### erase remote files $rmfile = "$remote/testftp.sum $remote/testftp.resum"; for ($i=0; $i < $count; $i++){ for ($j=0; $j < $file; $j++){ $rmfile.= " $remote/testftp.$i.$j"; } } TELNET("rm -f $rmfile","rmdir $remote"); last CYCLE if ($int); } } for ($i=0; $i < $file; $i++){ unlink("$local/testftp.dat.$i"); } unlink("$local/testftp.sum"); unlink("$local/testftp.resum"); # printing result print "\n*************** File Transfer Testing Results ***************\n"; print "Transfer $file files of $byte mega bytes for $count times per round\n"; for ($i=0; $i < $time; $i++){ $j = $i + 1; $error_msg = "error $error[$i] time. unmatch $error_sum[$i] time"; $result = ($error[$i]) ? "FAIL. $error_msg" : "OK"; $urate = sprintf("up %.1f kb",$urate[$i]); $drate = $drate[$i] ? sprintf("down %.1f kb",$drate[$i]) : "" ; print "$j round: $urate $drate /sec .$result\n"; } @error = @error[0..$time-1]; @success = grep($_ == 0,@error); $success = @success ; $fail = $time - $success ; print "\nTotal success $success times.\n"; print "Total fail $fail times\n\n"; if ($int){ print "User interrupt. Please remove testing files...\n\n"; } exit(0); ## ********************************************************************** sub MY_SIG_INT { kill('INT',$pid) if (defined($pid)); $int = 1; } sub GETSUM{ # input file name. md5sum file name. output md5sum my $sum ; if ($pid = fork()){ waitpid($pid,0); undef($pid); }else{ die("can not fork $!") if (! defined($pid)); exec("$md5sum $_[0] > $_[1]"); die("can not exec $!"); } return(undef()) if ($int); open(FILE,"$_[1]"); $sum=<FILE>; close(FILE); ($sum) = $sum =~ /^(\S+)/ ; return($sum); } sub TELNET{ # input command string my $cmd ; $cmd = "-c 'spawn telnet $host' "; $cmd.= "-c 'set timeout -1' "; $cmd.= "-c 'expect login:' "; $cmd.= "-c 'sleep 1' "; $cmd.= "-c 'send $user\\r' "; $cmd.= "-c 'expect Password:' "; $cmd.= "-c 'sleep 1' "; $cmd.= "-c 'send $passwd\\r' "; foreach $command (@_){ $cmd.= "-c 'expect ]' "; $cmd.= "-c 'send \"$command\\r\"' "; } $cmd.= "-c 'expect ]' "; $cmd.= "-c 'send exit\\r' "; $cmd.= "-c 'expect eof' "; if ($quiet){ $cmd = "$expect $cmd >/dev/null"; }else{ $cmd = "$expect $cmd"; } if ($pid = fork()){ waitpid($pid,0); undef($pid); }else{ die("can not fork $!") if (! defined($pid)); exec("$cmd") || die("can not exec $!"); } } sub FTP { ### input command string my $cmd ; $cmd = "-c 'spawn ftp $host' "; $cmd.= "-c 'set timeout -1' "; $cmd.= "-c 'expect Name' "; $cmd.= "-c 'send $user\\r' "; $cmd.= "-c 'expect Password:' "; $cmd.= "-c 'send $passwd\\r' "; $cmd.= "-c 'expect ftp>' "; $cmd.= "-c 'send bi\\r' "; foreach $command (@_){ $cmd.= "-c 'expect ftp>' "; $cmd.= "-c 'send \"$command\\r\"' "; } $cmd.= "-c 'expect ftp>' "; $cmd.= "-c 'send bye\\r' "; $cmd.= "-c 'expect eof' "; if ($quiet){ $cmd = "$expect $cmd >/dev/null"; }else{ $cmd = "$expect $cmd"; } if ($pid = fork()){ waitpid($pid,0); undef($pid); }else{ die("can not fork $!") if (! defined($pid)); exec("$cmd") || die("can not exec $!"); } } -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: [email protected] (sky), 看板: Linux 標 題: Re: [拜託看一下]你的 Linux Server 穩定嘛?? 發信站: 交大資科_BBS (Thu Dec 2 20:26:15 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!ctu-peer!news.nctu!news.iim.nctu!news.cis.nct 看樣子好像找到罪魁禍首了 !!! (已經收到一堆抱怨 server 當掉的電話) 把 mars_nwe down 下來之後,連續傳了 16 GB 的資料都沒有出錯 接著把 mars_nwe 啟動,很快 fail 就出現了 !!! 大約傳了 1GB 多一點 就 fail 了 !!! 天吶 !!! 我用的 kernel 是 2.2.13, 網卡 3c905b with 0.99L driver 所以這應該算是 linux 的 bug 囉?? ipx 和 ip 一起用時 ip 會出錯... 而且這個問題通常只發生在 server 接受資料時,換言之, linux 傳資料給別人沒問題,但別人傳的資料 linux 會弄錯 :( 然後該怎麼辦呢? 我們是不可能停掉 ipx 的,因為有許多機器設備只能跑 ipx ... 該把這個問題通知誰呢? -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: [email protected] (chelonian), 看板: Linux 標 題: Re: [拜託看一下]你的 Linux Server 穩定嘛?? 發信站: 奇摩大摩域 (Fri Dec 3 09:46:22 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!news.cs.nthu!bbsnews.kimo.com.tw!KimoBBS ※ 引述《[email protected] (sky)》之銘言: > ==> 在 tbsky@cis_nctu (sky) 的文章中提到: > > 前幾天我從 windows 裡面上傳了一個一百多 mega 的 .zip > > 檔案到 linux server. 順便在 server 上 unzip -t 檢查一下, > > 結果是錯的。於是展開了數天來的奮戰。 post 這個狀況到 > > 板上幾乎沒人理我,只有一個人回我 e-mail :( > > 所以再 post 一次。 sorry. > > 現在我不確定這是否是 linux 的問題,因為我沒有太多機器可以測試 > > 這邊的五台 linux 機器都會出問題就是了. > > 一開始我以為是網路卡 or 網路卡驅動程式的問題,硬體也換了,驅動程式 > > 也更新了,但還是不行,所以我有開始有點懷疑 linux 了.... > > 我寫了一個小程式來測試,可否請大家幫我試一試,看看你的 linux 機器跑 > > 起來如何. 這個程式用到 perl 和 expect 和 md5sum, 還有 ftp 和 telnet linux 我還不太懂,我只說我在硬體上的一點經驗! 其實早一些時候的pentium mmx 的板子用pci的網路卡,硬體本 身就會出錯,我是用dos 6.22 加novell來測的,先用xcopy 傳檔,再用FC比較檔案,都會不正確,先是國眾的 pentium 166跟200,叫國眾的工程師來也無法解決!後來是技 嘉的板子,退了五片板子回去,不過技嘉的工程師好像比較勵 害一點,回去搞了幾個月,換回來幾片新版的板子,問題就解 決了! 現在換到pII的板子,測國眾的板子都沒問題了! -- ※ Origin: 奇摩 大摩域 <telnet://bbs.kimo.com.tw> ◆ From: 203.66.51.14 > -------------------------------------------------------------------------- < 發信人: [email protected] (nobody), 看板: Linux 標 題: Re: [拜託看一下]你的 Linux Server 穩定嘛?? 發信站: 程式設計樂園(CSZone) (Fri Dec 3 11:45:33 1999) 轉信站: Ptt!news.ntu!CSZone 我有用過ipx,ip,和netbuei三種protocol在同一台Linux上. 跑起來並沒有問題. 我是用 kernel 2.0.0的.是舊了一點, 但是用了快2年都沒什麼問題. 既然沒問題我就不會去用新版,也麻煩. 我有用過mars_nwe當Novel Netware Server, 但只是做測試就拿掉了. 因為我們是有真正的Novel Server, 然後在Linux上跑ncpfs. 可是之前在用mars_nwe的時候,也有測過大量資料搬移. 大概連續傳/抓1.5G-2G左右的檔案.也沒有問題呀. 我的測試平台 mars_nwe-0.98.pl5 ncpfs-2.0.11 slackware 3.0 kernel 2.0.0 光華牌電腦. P-166, 32M RAM, 2G SCSI 硬碟, NE2000 compatible 網卡 : 看樣子好像找到罪魁禍首了 !!! (已經收到一堆抱怨 server 當掉的電話) : 把 mars_nwe down 下來之後,連續傳了 16 GB 的資料都沒有出錯 : 接著把 mars_nwe 啟動,很快 fail 就出現了 !!! 大約傳了 1GB 多一點 : 就 fail 了 !!! 天吶 !!! : 我用的 kernel 是 2.2.13, 網卡 3c905b with 0.99L driver : 所以這應該算是 linux 的 bug 囉?? : ipx 和 ip 一起用時 ip 會出錯... : 而且這個問題通常只發生在 server 接受資料時,換言之, : linux 傳資料給別人沒問題,但別人傳的資料 linux 會弄錯 :( : 然後該怎麼辦呢? : 我們是不可能停掉 ipx 的,因為有許多機器設備只能跑 ipx ... : 該把這個問題通知誰呢? -- ※ Origin: 程式設計樂園 ◆ From: www.adi.net.tw > -------------------------------------------------------------------------- < 發信人: [email protected] (hung), 看板: Linux 標 題: Re: [拜託看一下]你的 Linux Server 穩定嘛?? 發信站: 中山計中美麗之島 (Fri Dec 3 13:34:20 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!news.cs.nthu!netnews.csie.nctu!ED307NCTU!news ==> [email protected] (nobody) 的文章中提到: >我有用過ipx,ip,和netbuei三種protocol在同一台Linux上. >跑起來並沒有問題. >我是用 kernel 2.0.0的.是舊了一點, >但是用了快2年都沒什麼問題. >既然沒問題我就不會去用新版,也麻煩. >我有用過mars_nwe當Novel Netware Server, >但只是做測試就拿掉了. >因為我們是有真正的Novel Server, >然後在Linux上跑ncpfs. >可是之前在用mars_nwe的時候,也有測過大量資料搬移. >大概連續傳/抓1.5G-2G左右的檔案.也沒有問題呀. >我的測試平台 >mars_nwe-0.98.pl5 >ncpfs-2.0.11 >slackware 3.0 kernel 2.0.0 >光華牌電腦. P-166, 32M RAM, 2G SCSI 硬碟, NE2000 compatible 網卡 >: 看樣子好像找到罪魁禍首了 !!! (已經收到一堆抱怨 server 當掉的電話) >: 把 mars_nwe down 下來之後,連續傳了 16 GB 的資料都沒有出錯 >: 接著把 mars_nwe 啟動,很快 fail 就出現了 !!! 大約傳了 1GB 多一點 >: 就 fail 了 !!! 天吶 !!! >: 我用的 kernel 是 2.2.13, 網卡 3c905b with 0.99L driver >: 所以這應該算是 linux 的 bug 囉?? >: ipx 和 ip 一起用時 ip 會出錯... >: 而且這個問題通常只發生在 server 接受資料時,換言之, >: linux 傳資料給別人沒問題,但別人傳的資料 linux 會弄錯 :( >: 然後該怎麼辦呢? >: 我們是不可能停掉 ipx 的,因為有許多機器設備只能跑 ipx ... >: 該把這個問題通知誰呢? 我的 slackware 3.6 kernel 2.2.3 server 裝了 mars_nwe-pl17 每次開 nwserv 時 用 ifconfig -a 就發現 collision 持續增大. -- * Origin: 中山大學-美麗之島BBS * From: 163.16.38.123 [已通過認證]