bringing multi-threading to the i/o level - percona · title: turning uncertainty into advantage...
TRANSCRIPT
![Page 1: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/1.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved.
Rodrigo MedeirosSolutions Architect, Data Platforms
@rationalrodrigo @DataCore
Bringing Multi-Threading to the I/O Level
![Page 2: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/2.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 2
Objectives
• Discuss I/O parallelism and how it affects database performance
• Discuss compute parallelism vs I/O parallelism
• Demo: software solution to improve I/O
![Page 3: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/3.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 3
So Much Data, So little Time
• Large data sets even in small dataset
• Global business, activity in multiple time zones = 24/7 activity
• Smaller windows for Batch Processing
• Fresh, accurate, and readily available, regardless of volume.
“ ”Sir Arthur Conan Doyle: author of Sherlock Holmes
I never guess. It is a capital mistake to theorize before one has data.
![Page 4: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/4.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 4
![Page 5: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/5.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 5
Transaction Processing
• A two-second response is too much
• Online experience and the expectation of near-instant responses
• Larger volumes of data
• Sub-second search and update requirements
• Data-intensive UX pushing the volume of reads higher
“ ”Oprah Winfrey
You can have it all. Just not all at once.
![Page 6: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/6.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 6
• Processing power / cores
• Memory
• Storage
• Network
• More nodes
Downside
• Have to ask (plead)
• Hard to guess which one to start with?
• Get it wrong and it gets harderto ask again
“Throwing hardware” at the problem
![Page 7: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/7.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 7
• Collect Data
• Identify bottlenecks
• Change code, indexes, settings
• Test and deploy
Fixing the Code
![Page 8: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/8.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 8
• Layers of I/O developed for a single CPU
• Assumption: it will be slow, so don’t wait for it
• Global queues
• Some serialization
• Legacy code in the I/O stack
The unusual suspect
![Page 9: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/9.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved.
• Parallel processing background
• Pioneers in Software Defined Storage (SDS)
• Patent holders of Thin Provisioning
• World record for Storage Performance Council
• SPC-1 2016, 5M IOPS, 1/5th of the cost of 2nd place
• MaxParallel is part of a successful SDS stack
• Production installs for over 2 decades
9
About DataCore
![Page 10: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/10.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 10
No parallelism in I/O and Database Performance
4 concurrenttasks on 8-coreserver
![Page 11: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/11.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 11
Amdahl's Law
![Page 12: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/12.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 12
Increased I/O complexity in virtualized environments
Latency variability at the storage layer
Adding complexity to the picture…
![Page 13: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/13.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 13
Asynchronous I/O and context switching
![Page 14: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/14.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 14
Asynchronous I/O with very fast drives
![Page 15: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/15.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 15
Synchronous I/O
![Page 16: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/16.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved.
• Minimize suspension and context switching caused by I/O delays
• Smarter I/O cache
• Smarter read-ahead
• Speed matching buffer (for bursts of writes)
• Implement multiple I/O queues, multi-threaded I/O processing
• Smarter I/O scheduling
• Helper threads
16
Potential Solutions
![Page 17: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/17.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 17
Faster data access + better CPU utilization
Delays & waste causedby serial scheduling
Parallel I/Owith DataCore
![Page 18: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/18.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved.
Demo: MaxParallel on Windows
18
![Page 19: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/19.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 19
Windows: filter driver (kernel) Linux: block device
Where it resides
![Page 20: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/20.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved. 20
• Serialization in I/O can hinder performance…and may not be immediately visible
• Additional Toolsoftware can be an additional tool in performance optimization
• Good fit in some environments higher core count, heavy and diverse workloads, slow drives
• Not relevant in some environments over-provisioned hardware, modest workloads, fast drives
Summary
![Page 21: Bringing Multi-Threading to the I/O Level - Percona · Title: Turning Uncertainty into Advantage Author: Augie Gonzalez Created Date: 4/27/2018 5:41:06 PM](https://reader033.vdocument.in/reader033/viewer/2022042920/5f665787cebe2f6d2e40c767/html5/thumbnails/21.jpg)
Copyright © 2018 DataCore Software Corp. – All Rights Reserved.
www.datacore.com
@DataCore
@rationalrodrigo