ATS currently supports SSDs, however it does not take the best advantage
of their special characteristics. In particular, SSDs could be used as
an addition level in the cache (between RAM and traditional platter-based
hard drives (HDDs)), and SSDs could benefit from reducing writes. Currently
we write all misses to disk but we could write only (for example) on
seeing the second miss to a particular URL.
- large working set, few HDDs, low RAM reverse proxy
- large working set, many HDDs, probably forward proxy, but perhaps shard CDN
- no moving parts forward or reverse proxy, 0 HDDs
NOTE: situations with a small working set and adequate RAM fall will not benefit
performance-wise from an SSD, however because of the relatively limited number
of write cycles supported by SSDs currently, specialized SSD support might improve
longevity and reliability.
- support for re-writing warm content to an SSD if read from spinning media
- this is uses the SSD as an additional level in the hierarchy between RAM and HDD
- support for only writing the second miss in an SSD-only environment
The Interim Caching Layer
From V6.0.0, the interim caching feature is removed, please consider other options.
When we thinking about the storage of ATS, the original desigin is to support many disks, with the same size(best work with block devices without raid), and build up the volumes(partitions), then assign each of the volumes to some domain(hostname), we find out that if we don't make big change in the storage design, we don't have a easy way to archive the multi-tiered caching storage, then we come to the following INTERIM solution:
- we think that if your deployed mixed storage, the fast device is less. IE, 1/10 of the slow devices, in size or in counts.
- we assume that in most case, 8 fast disks is fairly many.
- we assume your slow disk should not go beyond 32TB per disk.
- the slow devices holding all the data, should not loss them when fast disk fails.
- compare to the storage percent, ie 10%, the fast devices may loss data during the server restart.
- the fast disks should balance to all the slow disks, in size and even in IOPS. the volumes is building upon the slow disks, with slices from every disks, we should spread the load on each fast disk too.
we make a design with balance:
- a interim cache of the cache, which is lived on the fast disks(SSD in most case), will loss the data if you restart the server process. make the data on interim caching device a real interim.
- we support 8 fast disks at most
- we make a block level interim cache, which does not contains any index info
what we have done:
- we steal 4bit from the Dir struct, to identify each of the fast disks
- we cut down the up limit of the disk in size to 32TB
- we split each fast disks into volumes confiured in the volume.config, and bind them.
- we store the interim data in the dir on the slow storages
- write data from the origin server on the slow disks
- we setup a interal LRU list, limited in size(1M bucket), and bump the busy blocks into fast device
- we do hot data evocation on the interim caching devices, to make it more efficent, we do compare the blocks with the LRU list
- the interim cache device(fast disks), works with RRD writing too.
coins and pins:
- we make a solid solution without big change in the storage architecture
- the LUR help us get the hot blocks, it is efficent
- the block layer interim caching can help on small objects and big ones too
- loss data if the server process crash Fixed in TS-2275
- limited in block device only for used as interim caching device
- the interim caching device space is not a add-on, but a copy of the hot data on the slow devices
- we set lower the max disk size of the storage from 0.5PB to 32TB.
- the interim caching function is not enabled by default configuration
codes & structs:
the change of Dir:
we split the stat of read_success into disk, interim and ram:
how to enable interim caching:
configure to enable the interim caching function:
add '--enable-interim-cache' option.
we introduced two record config:
disk device(s) for the interim cache, we only support block devices in full path, multipule disks may seperate by SPACE. example: LOCAL proxy.config.cache.interim.storage STRING /dev/sdb /dev/sdc1
controls how many times one content should be migrate to the interim cache from the storage, which will control the writing on the interim disk. default to '2', which means it should be seen in the LRU list two times before we thinking of migrate it to the interim caching device.
some of the result:
we have a system with 160G SSD + 3 * 500G SAS, 16G RAM, 4 cores, here is the result of tsar and iostat -x: