iscsi-client.rcS revision 3032:dc687512802b
1#!/bin/sh
2#
3# /etc/init.d/rcS
4#
5
6echo -n "mounting swap..."
7/sbin/swapon /dev/hdc
8echo "done."
9
10echo -n "setting up network..."
11/sbin/ifconfig lo 127.0.0.1
12/sbin/ifconfig eth0 192.168.0.10 txqueuelen 1000
13
14echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
15echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
16echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
17echo "0" > /proc/sys/net/ipv4/tcp_timestamps
18echo "0" > /proc/sys/net/ipv4/tcp_sack
19echo "15" > /proc/sys/net/ipv4/tcp_fin_timeout
20echo "16384" > /proc/sys/net/ipv4/tcp_max_syn_backlog
21echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
22echo "1024 65535" > /proc/sys/net/ipv4/ip_local_port_range
23echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_rmem
24echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_wmem
25echo "10000000 10000000 10000000" > /proc/sys/net/ipv4/tcp_mem
26#echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
27echo "524287" > /proc/sys/net/core/rmem_max
28echo "524287" > /proc/sys/net/core/wmem_max
29echo "524287" > /proc/sys/net/core/optmem_max
30echo "300000" > /proc/sys/net/core/netdev_max_backlog
31echo "131072" > /proc/sys/fs/file-max
32echo "1" > /proc/sys/vm/dirty_writeback_centisecs
33echo "done."
34
35cat > /etc/initiatorname.iscsi <<EOF
36InitiatorName=iqn.1987-05.10.0.168.192
37EOF
38
39cat > /etc/iscsid.conf <<EOF
40node.active_cnx = 1
41node.startup = manual
42#node.session.auth.username = dima
43#node.session.auth.password = aloha
44node.session.timeo.replacement_timeout = 0
45node.session.err_timeo.abort_timeout = 10
46node.session.err_timeo.reset_timeout = 30
47node.session.iscsi.InitialR2T = No
48node.session.iscsi.ImmediateData = Yes
49node.session.iscsi.FirstBurstLength = 262144
50node.session.iscsi.MaxBurstLength = 16776192
51node.session.iscsi.DefaultTime2Wait = 0
52node.session.iscsi.DefaultTime2Retain = 0
53node.session.iscsi.MaxConnections = 0
54node.cnx[0].iscsi.HeaderDigest = None
55node.cnx[0].iscsi.DataDigest = None
56node.cnx[0].iscsi.MaxRecvDataSegmentLength = 65536
57#discovery.sendtargets.auth.authmethod = CHAP
58#discovery.sendtargets.auth.username = dima
59#discovery.sendtargets.auth.password = aloha
60EOF
61
62#mount -t sysfs none /sys
63
64echo "" > /var/log/iscsi.log
65chmod 0600 /var/log/iscsi.log
66chmod 0666 -R /var/db/iscsi
67
68# Required for udev to activate/deactivate devices.
69echo "/sbin/hotplug" > /proc/sys/kernel/hotplug	
70
71/sbin/insmod /modules/scsi_transport_iscsi.ko
72/sbin/insmod /modules/iscsi_tcp.ko
73
74echo "Starting iscsid..."
75/iscsi/iscsid -f &
76
77sleep 1
78
79echo "Waiting for server..."
80netcat -c -l -p 8000 
81
82echo "Attaching target..."
83/iscsi/iscsiadm -m discovery -t st -p 192.168.0.1
84/iscsi/iscsiadm -m node -r a0c049 --login
85echo "done."
86
87sleep 5
88
89#PARAMS="-n 8 -s 8 -r .666 -c 50"         # lisa default
90#PARAMS="-n 8 -s 5120 -r .666 -c 20"      # very unstable
91#PARAMS="-n 8 -s 8 -r 0 -c 20"            # very unstable
92#PARAMS="-n 8 -s 8 -r 1 -c 20"            # stable 960 Mbps
93#PARAMS="-n 8 -s 1024 -r 1 -c 20"         # very unstable
94#PARAMS="-n 16 -s 32 -r 1 -c 50"          # stable ~1.5 Gbps
95#PARAMS="-n 50 -s 32 -r 1 -c 50"          # stable ~1.5 Gbps
96PARAMS="-n 50 -s 8 -r .666 -c 50"
97COMMAND="/benchmarks/aio-bench $PARAMS -i 1000000 -C 50000 /dev/sda"
98
99echo "Starting aio benchmark..."
100echo $COMMAND
101eval $COMMAND
102
103echo "starting bash shell..."
104/bin/bash
105
106echo -n "halting machine"
107m5 exit
108