锁(Locks):保证了并发控制(CC)的正确性但又限制了系统的扩展性(Scalability)怎么办?
锁 (Locks): 保证了并发控制 (CC) 的正确性 但又限制了系统的扩展性 (Scalability) 怎么办? 1
计算机系统本质是什么?,提供计算,通讯和数据处理的通用基础设施(包括硬件和软件)·不再只是操作系统和CPU芯片·也不是为特殊应用专制的硬件或开发的软件·除操作系统以外的主流系统有:·存系统·数据管理系统·虚拟机系统·互联网系统·有大规模应用软件系统,如微信,云系统中的资源分享和调度系统。。·计算机系统的开发和应用具有很严格的基础性·很多系统上创新都是来源于对系统基本结构的深刻认识·系统资源管理和社会分配体制有共性·思考和分析问题不应只限于技术层面·所有的算法和解决方案都可以在社会和日常生活中找到·系统研究的最终目的"Theproofofasystem'svalueisitsexistence."AlanPerlis
计算机系统本质是什么? • 提供计算,通讯 和数据处理的通用基础设施(包括硬件和软件) • 不再只是操作系统和CPU芯片 • 也不是为特殊应用专制的硬件或开发的软件 • 除操作系统以外的主流系统有: • 存贮系统 • 数据管理系统 • 虚拟机系统 • 互联网系统 • 有大规模应用软件系统,如微信,云系统中的资源分享和调度系统 。 • 计算机系统的开发和应用具有很严格的基础性 • 很多系统上创新都是来源于对系统基本结构的深刻认识 • 系统资源管理和社会分配体制有共性 • 思考和分析问题不应只限于技术层面 • 所有的算法和解决方案都可以在社会和日常生活中找到 • 系统研究的最终目的 • “The proof of a system’s value is its existence.” Alan Perlis
Throughput drops after reaching peak (MysQl)sysbench,PKlookupsKernal mutexinSQLisa150000synchronization lock.Thisisexperimentselectsprimarykeysin5millions1rows eachbyusingthelock.PeakTX=154,236(64pros)50000·AfterthenTXdrops14%·7timeslowerthanthepeak(1024processes)256128882645121024ThreadsPerconaDBPerformance
Throughput drops after reaching peak (MySQL) 3 Kernal_mutex in SQL is a synchronization lock. This is experiment selects primary keys in 5 millions rows each by using the lock. • Peak TX =154,236 (64 pros) • After then TX drops 14% • 7 times lower than the peak (1024 processes) PerconaDB Performance
Latencyincreases as #threads increaseto contend locksSeirtcolFree(MPMC)600065004threadsusing5000spinlock running on4500IntelXeonL5640fora4000write-readworkload(dasp)aae3500comparedwiththe3000sameworkloadinlock2500freestyle200015001000ACMQueue,June20135000.20.30.60.70.10.40.50.80.9Quantile
Latency increases as # threads increase to contend locks 4 4 threads using spinlock running on Intel Xeon L5640 for a write-read workload compared with the same workload in lockfree style ACM Queue, June 2013
System Performance: High Throughput and Low LatencyOptimal PointLatency (locality)Throughput(parallelism)NumberofConcurrentProcesses
Number of Concurrent Processes Optimal Point Throughput (parallelism) Latency (locality) System Performance: High Throughput and Low Latency