トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS

#contentsx
***Link [#s9564d90]
-[[IBM Linux技術情報>http://www.ibm.com/developerworks/jp/views/linux/libraryview.jsp]]
-[[エラーメッセージ検索>http://ossmpedia.org/]]
-[[sysstat>http://perso.orange.fr/sebastien.godard/]]

***チューニング [#iae792a6]
-IPv4関連
http://www.linux.or.jp/JF/JFdocs/kernel-docs-2.4/networking/ip-sysctl.txt.html

-最大プロセス数
Linuxにおける最大プロセス数の考え方は、プロセス数+スレッド数。また、glibcに関連する場合の最大スレッド数はPTHREAD_THREADS_MAXの定義を確認。
 /proc/sys/kernel/threads-max
参考: http://www-1.ibm.com/support/docview.wss?uid=std34e38bb4af846cc0c49256f01003acf01

-メモリオーバーコミット(Kernel 2.6 uppper)
メモリが逼迫した状況でも、memory overcommit によるプロセスの突然死を起こしたくな い状況ではproc/sys/vm/overcommit_memory を "2" にし、
かつ overcommit_ratio を調整して "malloc_limit"値 が物理メモリ量を超えないようにすれば良い
 malloc_limit[MB]= swap領域のサイズ[MB] + (物理メモリ量[MB] * overcommit_ratio / 100)
 
 # sysctl -w vm.overcommit_ratio=99
 # sysctl -w vm.overcommit_memory=2

***Kernel Build [#d0d4bdf4]
 # cp old/.config 
 # make dep
 # make bzImage
 # make modules
 # make modules_install
 
 # cat arch/i386/boot/bzImage > /boot/vmlinuz-2.6.20.1
 # cp System.map /boot/System.map-2.6.20.1
 
 
 # cd /boot
 # mkinitrd initrd-2.6.20.1 2.6.20.1
 # ls -la initrd-2.6.20.1
 -rw-r--r-- 1 root root 115561  2月21日 02:20 initrd-2.6.20.1
 # mv initrd-2.6.20.1 initrd-2.6.20.1.img
 # cd /etc
 # cp -ip lilo.conf lilo.conf.yyyymmddnn
 # vi lilo.conf 
 # /sbin/lilo
 
 Warning:  LINEAR is deprecated in favor of LBA32:  LINEAR specifies 24-bit
   disk addresses below the 1024 cylinder limit; LBA32 specifies 32-bit disk
   addresses not subject to cylinder limits on systems with EDD bios extensions;
   use LINEAR only if you are aware of its limitations.
 
 Added linux
 Added linux2619 *
 Added linux2620
 
 # rm System.map
 # ln -fs System.map-2.6.20.1 System.map


 # cat lilo.conf
 prompt
 timeout=20
 default=linux2619
 boot=/dev/hda
 map=/boot/map
 install=/boot/boot.b
 linear 
 
 image=/boot/vmlinuz-2.6.16-0vl60
         label=linux
         initrd=/boot/initrd-2.6.16-0vl60.img
         read-only
         append="root=LABEL=/"
 
 image=/boot/vmlinuz-2.6.19.1
         label=linux2619
         initrd=/boot/initrd-2.6.19.1.img
         read-only
         append="root=LABEL=/"
 
 image=/boot/vmlinuz-2.6.20.1
         label=linux2620
         initrd=/boot/initrd-2.6.20.1.img
         read-only
         append="root=LABEL=/"


***インテル® PRO/1000 シリーズアダプター [#k7f536d4]
http://support.intel.co.jp/jp/support/network/adapter/1000/linux_readme.htm
-ジャンボフレーム(MTUサイズの増加)
通常、EtherのMTUサイズは1500Byteであるが、gigabit ether netwoarkにおいてはMTUサイズを増加させることでパフォーマンス向上を図ることができる。
 手動でのMTUサイズ変更(mtuサイズを9014byteに変更する場合)
 # /sbin/ifconfig eth0 mtu 9014 up
また、/etc/sysconfig/network-script/ifcfh-eth0に記述ることで対応が可能である。
 追加する設定値(mtuサイズを9014byterに変更する場合)
 MTU=9014
MTUサイズはifconfigコマンドで確認できる。
 # /sbin/ifconfig eth0

-ネゴシエーション設定
リンクスピードを固定化する場合などの設定はモジュールのオプションで行う。
 Duplex
 値範囲:0-2 (0=auto-negotiate、1=half、2=full)
 デフォルト値:0
 
 Speed
 値範囲:0、10、100、1000(0=auto-negotiate)
 
 FlowControl
 値範囲:0-3 (0=none、1=Rx only、2=Tx only、3=Rx&Tx)
/etc/modprobe.conf例(複数インターフェースを持つ場合はカンマで列挙する)
 eth0はオートネゴシエート、eth1は100Mbps全2重で固定する場合
 eth0 e1000
 eth1 e1000
 options e1000 Speed=0,100 Duplex=0,2
設定内容はethtoolで確認できる。
 # ethtool eth0

***ユーザーID管理のメモ [#xb8e7e02]
 # chage
 Usage: chage [-l] [-m min_days] [-M max_days] [-W warn]
        [-I inactive] [-E expire] [-d last_day] user

 # usermod
 使用法: usermod [-u ユーザID [-o]] [-g グループ] [-G グループ,...]
                [-d ホーム [-m]] [-s シェル] [-c コメント] [-l 新規ユーザ名]
                [-f 無効日数] [-e 期限切れ日 ] [-p パスワード] [-L|-U] ユーザ名


-/etc/shadowファイルのフォーマット
username:passwd:last:may:must:warn:expire:disable:reserved
,username,passwd,last,may,must,warn,expire,disable,reserved
,ユーザ名,エンコードされたパスワード,1970年1月1日から、パスワードが最後に更新された日までの日数,何日前にパスワードが変更されたと思われるか,パスワードを変更しなければならない期限,パスワードの期限切れの何日前にユーザに警告するか,パスワード期限切れの何日後にアカウントを抹消するか,1970年1月1日から、アカウントが抹消された日までの日数,予約フィールド


-ロック
--状況表示
 # faillog -u username
--ロックの解除
 # faillog -r username

***3CFE575CTを100Mbps-Full Duplexにする方法 [#id0ce339]
3COMのCardBus NICのリンクアップスピードを変更する方法
 [root@misago /root]# mii-diag eth1 -F 100baseTx-FD~
 Setting the speed to "fixed", Control register 2100.~
 Basic registers of MII PHY #0:  2100 780d 0300 e54b 01e1 0000 0000 0000.~
  Basic mode control register 0x2100: Auto-negotiation disabled, with~
  Speed fixed at 100 mbps, full-duplex.~
  You have link beat, and everything is working OK.~
  Link partner information is not exchanged when in fixed speed mode.~
    End of basic transceiver information.

***Channel Bonding [#lcf7c343]
http://mikilab.doshisha.ac.jp/dia/research/person/atsushi/bonding1.html

***VineLinux VersionUp [#i4c9ba8b]
 [root@inasa apt]# apt-get update 
 取得:1 http://updates.vinelinux.org 4.1/i386 release [2254B]
 2254B を 0s 秒で取得しました (15.4kB/s) 
 取得:1 http://updates.vinelinux.org 4.1/i386/main pkglist [286kB]
 取得:2 http://updates.vinelinux.org 4.1/i386/main release [158B]
 取得:3 http://updates.vinelinux.org 4.1/i386/plus pkglist [484kB]
 取得:4 http://updates.vinelinux.org 4.1/i386/plus release [166B]
 取得:5 http://updates.vinelinux.org 4.1/i386/updates pkglist [47.0kB]
 取得:6 http://updates.vinelinux.org 4.1/i386/updates release [169B]
 取得:7 http://updates.vinelinux.org 4.1/i386/nonfree pkglist [5713B]
 取得:8 http://updates.vinelinux.org 4.1/i386/nonfree release [169B]
 取得:9 http://updates.vinelinux.org 4.1/i386/main srclist [121kB]
 取得:10 http://updates.vinelinux.org 4.1/i386/plus srclist [199kB]
 取得:11 http://updates.vinelinux.org 4.1/i386/updates srclist [10.4kB]
 取得:12 http://updates.vinelinux.org 4.1/i386/nonfree srclist [10.1kB]
 1164kB を 2s 秒で取得しました (389kB/s)
 セグメンテーション違反ですでいます... 0%
 [root@inasa apt]# df -k
 ファイルシステム     1K-ブロック  使用        空き 使用% マウント位置
 /dev/hda2               295555    205949     74345  74% /
 /dev/hda1               295561     19266    261035   7% /boot
 none                    159396         0    159396   0% /dev/shm
 /dev/hda9              2063504   1293848    664836  67% /home
 /dev/hda5              5162796   2683200   2217340  55% /usr
 /dev/hda8              2063504    433332   1525352  23% /var
 /dev/hda7              5162796   2917248   1983292  60% /usr/local
 /dev/hda6              5162796    145496   4755044   3% /opt
 /dev/hda11           120001836  86234892  33766944  72% /data
 /dev/hda12            92941156  34605428  58335728  38% /data/itune
 [root@inasa apt]# apt-get dist-upgrade
 セグメンテーション違反ですでいます... 0%
 [root@inasa apt]# mv /var/cache/apt/pkgcache.bin /var/cache/apt/pkgcache.bin.bak
 [root@inasa apt]# mv /var/cache/apt/srcpkgcache.bin  /var/cache/apt/srcpkgcache.bin.bak

***Tips [#bd6ab050]
-HDDのパーティションにラベルを付ける
 # e2label /dev/hdaxx /labelname
-RAM tmpファイルシステムを使う
ファイルシステムタイプ tmpfsはメモリ上に展開される。/dev/shmにマウントされる。
実際にファイルI/Oに使うには下記のようにマウントする。(/tmpに32MB RAM上から割り当てられる)
サイズ指定しない場合は実メモリの半分が割り当てられる。
 # mount -t tmpfs -o size=32m tmpfs /tmp
/etc/fstabにも記述可能。
 /dev/shm             /tmp                    tmpfs    defaults,size=64m        0 0

-fsckのタイミングを変更する(extファイルシステム)
ext2/ext3ファイルシステムはマウント回数ないし前回のfsckからの日数に応じてマウント時にfsckが走る。このタイミングの確認方法と変更方法を述べる。
--確認方法
 # tune2fs -l /dev/sda1
 tune2fs 1.38 (30-Jun-2005)
 Filesystem volume name:   /tmp
 Last mounted on:          <not available>
 Filesystem UUID:          ec13809c-1224-40b2-9f8d-39fb409d2a8d
 Filesystem magic number:  0xEF53
 Filesystem revision #:    1 (dynamic)
 Filesystem features:      has_journal resize_inode filetype needs_recovery  sparse_super
 Default mount options:    (none)
 Filesystem state:         clean
 Errors behavior:          Continue
 Filesystem OS type:       Linux
 Inode count:              32000
 Block count:              127984
 Reserved block count:     6399
 Free blocks:              117992
 Free inodes:              31958
 First block:              1
 Block size:               1024
 Fragment size:            1024
 Reserved GDT blocks:      256
 Blocks per group:         8192
 Fragments per group:      8192
 Inodes per group:         2000
 Inode blocks per group:   250
 Filesystem created:       Sat Oct 18 08:25:54 2008
 Last mount time:          Sat Oct 18 12:48:35 2008
 Last write time:          Mon Oct 20 10:25:21 2008
 Mount count:              7
 Maximum mount count:      27
 Last checked:             Sat Oct 18 08:25:54 2008
 Check interval:           15552000 (6 months)
 Next check after:         Thu Apr 16 08:25:54 2009
 Reserved blocks uid:      0 (user root)
 Reserved blocks gid:      0 (group root)
 First inode:              11
 Inode size:               128
 Journal inode:            8
 Default directory hash:   tea
 Directory Hash Seed:      a6087dca-8022-4b9b-99af-25e1ad6ae886
 Journal backup:           inode blocks
このうち、Mount Countが現在のマウント回数。Maximun mount countがfsckが実行されるマウント回数となる。
Last Checkedは最後にfsckが実行された日付。Check Intervalはfsckを実行する間隔を示す。

--変更方法
マウント回数によるfsckタイミング変更
 # tune2fs -c 2 /dev/sda1
 tune2fs 1.38 (30-Jun-2005)
 Setting maximal mount count to 2
fsck実行間隔の変更 - d(day),m(month),y(year)で指定することが可能。
 [root@inasa03 root]# tune2fs -i 3d /dev/sda1
 tune2fs 1.38 (30-Jun-2005)
 Setting interval between checks to 259200 seconds
http://blog.dc-d.jp/archives/63.html

----
#counter