PGCon2017 - 20180510

PGCon 2017
The PostgreSQL Conference

Speakers
Amit Kapila
Dilip Kumar
Schedule
Day Talks - Day 2 - 2017-05-26
Room DMS 1120
Start time 10:00
Duration 00:45
Info
ID 1041
Event type Lecture
Track Performance

PostgreSQL Entangled in Locks: Attempts to free it

Lock contention in PostgreSQL is one of the major woes for scalability concerns on many-core machines. We will discuss our attempts to solve those issues. The discussion will focus mainly on BufferMappingLock, WALWriteLock and CLogControlLock. First, we will describe our experiments wherein we split WALWriteLock in two separate locks — one for WAL write and another for WAL Flush. Next, a lockless implementation of the hash table for BufferMappingLock will be discussed. Finally, the presentation will conclude with a discussion on group clog update concept for reducing LockContention around ClogControlLock.

Lock contention in PostgreSQL is one of the major woes for scalability concerns on many-core machines. In the past, several attempts were made to fix different lock contention issues. Some of the contentions were solved to an extent e.g WALInsertLock, ProcArrayLock and BufFreelistLock. Still, there are many lock bottlenecks that remain unsolved mysteries, e.g ClogCotrolLock, WALWriteLock, BufferMappingLock, etc.

In this talk, we will present our experiments for wait event test to show the contentions on various locks. We also analysed the effects of these locks on various workloads. We will discuss the experiments done to reduce lock contention of various locks along with their performance results.

The discussion will focus mainly on BufferMappingLock, WALWriteLock and CLogControlLock. First, we will describe our experiments wherein we split WALWriteLock in two separate locks — one for WAL write and another for WAL Flush. Next, a lockless implementation of the hash table for BufferMappingLock will be discussed. Finally, the presentation will conclude with a discussion on group clog update concept for reducing LockContention around ClogControlLock.