synology technology alex wang may 1, 2008. outline hardware architecture software architecture...

40
Synology Technology Alex Wang May 1, 2008

Upload: erik-page

Post on 26-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Synology Technology

Alex Wang

May 1, 2008

Page 2: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Outline

Hardware architecture Software architecture Performance Competitive cost Quality

Page 3: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Hardware Architecture

Page 4: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Hardware Specification

DS107 DS207+ DS407 DS508

CPU Power PC 266MHz

ARM 500MHz

ARM 500MHz

PowerPC 800MHz

RAM 64 MB 128MB 128MB 512MB

Flash 2 MB 4 MB 4 MB 4 MB

Disk 1 2 4 5

USB 3 3 2 2

AC Adapter

50W 70W 100W 250W

Page 5: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality
Page 6: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

DS407 Board

Page 7: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Software Architecture

Page 8: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Software Architecture

1 source tree for multiple platform5 CPU, 19 models

Only change boot loader, kernel, and toolchain

Sometimes build our own toolchaincrosstool: http://www.kegel.com/crosstool/

Chroot build process

Page 9: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Flash Layout

Kernel0x200000, 2MB

Ramdisk0x180000, 1.5MB

uboot (0x40000)

Hw config (0x10000)

Reserved 0x20000

FIS directory (0x10000)

4 MB

Kernel0xD0000, 832 KB

Ramdisk0xD0000, 704KB

ppcboot (0x40000)

Hw config (0x10000)

Reserved 0x20000

FIS directory (0x10000)

2 MB

Page 10: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Boot Procedure

Boot loader

Ramdisk initrd

Kernel Kernel

Flash RAM

0xFFC00000

0xFFE00000

0x80000

0x800000

Copy kernel to RAM

1

2

3

4

5

Jump to kernel

Ramdiskinit

Ramdisklinuxrc.syno

Ramdisk/etc/rc Disk

/etc/rc

6

7

8 8

Kernel mounts memory disk

Page 11: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Boot Procedure

Page 12: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Network Service

Software Architecture

Linux Kernel, 2.6.15, 2.4.22

Web Applications

Synology SDK Library

Management UI

Disk Driver Network Driver USB Driver Synology HW driver

Page 13: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Performance

Page 14: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Read Performance

ARM 500 MHz

Intel Celeron 3.2GHz Celeron M 1.5 GHz

ARM 500 MHz

ARM 500 MHz

Page 15: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Read Performance

Intel Celeron 3.2GHz Celeron M 1.5 GHz

ARM 500 MHz

ARM 500 MHz

PowerPC 266 MHz

Page 16: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Write Performance

Page 17: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Read Performance

40% faster then original Linux kernelFTP download from 26 MB/s to 37 MB/s

1 year ahead to Linux kernel How?

Page 18: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Read Performance

At least 3 disks Allow 1 disk failure

1 2 34 5 P7 P 8P 10 11

P69

12

Page 19: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

RAID 5 Read Performance

1 2 34 5 P7 P 8P 10 11

P69

12

Stripe Cache (Used to check data consistency)

Read buffer

Memory copy

Memory copy

Page 20: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Reduce Memory Copy

for (;;) {cnt = read(file_fd, buf, sizeof(buf));if (cnt <= 0) break;

for (len = cnt, bp = buf; len > 0;) {cnt = write(sock_fd, bp, len);if (cnt < 0) error;len -= cnt;bp+=cnt;

}}

Download file

Page 21: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Reduce Memory Copy

Kernel

read()

write()

Disk

memory copy

memory copy

Network

User space daemon

Page 22: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

User space daemon

Reduce Memory Copy

Kernel

sendfile()

Disk

Network

cnt = sendfile(sock_fd, file_fd, offset, filesize);

Page 23: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Large Directory Handling

Windows uses case-insensitive Unix/Linux is case-sensitive How would Samba do to pretend it is case-

insensitive? Create/rename/delete/lookup

Page 24: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Large Directory Handling

Enumerate all files in the directory, convert file name to upper and do string compare!

What if there are more than 10,000 files in a directory?

Page 25: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Large Directory Handling

Modify EXT3 file system to be case-insensitive

Port EXT3 directory hash to 2.4 kernelopen() 10,000 files from 2mins to 10 sec

Page 26: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost

Page 27: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost

We are small company NAS is a small market Big companies get lower price because they

can share parts between different products How to compete? Software!!

Page 28: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Flash size

We use 2 MB or 4 MB flash Our competitor uses 16 MB flash

(or 512 KB flash and bundle disk) Don't bundle disk to avoid the risk of disk price

decline

2 MB $3

4 MB $4

16 MB $10

Page 29: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Flash size

Use 2.4 kernelsmaller footprint, better performance, FTP 20% faster

Network installationThe ramdisk in flash provides minimize function for installation only

Page 30: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Power Supply A 1TB Disk needs 40W PC server uses 350W power supply, noisy, large We use 100W adapter for 4 disk model, quiet, small 100 W for 4 disk+PCB?

40W Adapter $4

50W adapter (1 disk) $5.5

70W adapter (2 disks) $9

100W adapter (4 disks) $22

250W (PC) $28

Page 31: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Power Supply Disk spin up 35 W Disk access 14 W Disk idle 12 W Disk hibernation 0 W PCB 7~12 W Power up sequence

Page 32: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Power Supply

Page 33: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Power Supply Power up sequence

Software delay until disk ready, 40 seconds How about hibernation?

Page 34: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Competitive Cost – Power Supply Ask disk whether disk is hibernating before

access it When disk is hibernating and wake up the

first disk If other disks are waking up, put into queue to

delay wake up Extra command to ask status? Performance?

Page 35: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Quality

Page 36: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Quality - Reliability

Mass stress 12pic x 14days for every release MP - Stress memory for 24 hours MP - Stress with disk for 24 hours Production cost: 4 disks x 100 pics Production capacity: 100 per day

Page 37: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Quality – Software Dainty

Continuous free firmware upgrade Take care on small details File created time Unicode conversion Extended attribute RAID error handling

Page 38: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Quality – RAID Error Handling Read error?

1 2 B4 5 P7 P 8P 10 11

P69

12

Page 39: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Quality – RAID Error Handling Rewrite to leverage disk bad sector mapping

1 2 B4 5 P7 P 8P 10 11

P69

12

3

Page 40: Synology Technology Alex Wang May 1, 2008. Outline Hardware architecture Software architecture Performance Competitive cost Quality

Q&A

Yes, we are hiring