|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
我认为用ramdisk做嵌入式路由器是好的选择。下面是我做的在内存上运行的嵌入式路由器的一些数据:
看是否在内存上运行:
/ # mount
/dev/root on / type ext2(ro)
none on /dev type devfs(rw)
proc on /proc type proc(rw,nodiratime)
运行结果显示:没有硬盘,只有内存盘.
看硬盘(其实是内存盘)占用情况:
/ # df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.9M 2.6M 1.3M 67% /
运行结果显示:内存盘大小4M,root系统文件占用2.6M.
看内存使用情况:
/ # free
total used free shared buffers
Mem: 513664 14300 499364 0 3964
Swap: 0 0 0
Total: 513664 14300 499364
运行结果显示:内存有512M,使用了14M,其中4M是系统盘,实际使用内存量:10M.
/ # ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.0 ms
--- 127.0.0.1 ping statistics ---
11 packets transmitted, 11 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
对比开发机是同一台机器,FC4操作系统)
[root@localhost ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.073 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.050 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.049 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.049 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.050 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.051 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.051 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.051 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.057 ms
--- 127.0.0.1 ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 7998ms
rtt min/avg/max/mdev = 0.049/0.053/0.073/0.010 ms, pipe 2 |
|