You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-17Lines changed: 34 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ For the complete documentation of Kafka, refer to [here](README.kafka.md).
33
33
The easiest way to try Pafka is to use the docker image: https://hub.docker.com/r/4pdopensource/pafka-dev
34
34
35
35
```
36
-
docker run -it -v $YOUR_PMEM_PATH:/mnt/mem 4pdopensource/pafka-dev bash
36
+
docker run -it 4pdopensource/pafka-dev bash
37
37
```
38
38
39
39
where $YOUR_PMEM_PATH is the mount point of PMem (DAX file system) in the host system.
@@ -78,31 +78,49 @@ To verify the correctness, you can use any file systems with normal hard disks.
78
78
79
79
#### 3.3.2. Config
80
80
81
-
In order to support PMem storage, we add some more config fields to the Kafka [server config](config/server.properties).
81
+
In order to support tiered storage, we add some more config fields to the Kafka [server config](config/server.properties).
82
82
83
83
|Config|Default Value|Note|
84
84
|------|-------------|----|
85
-
|storage.pmem.paths|/pmem|pmem mount paths (separated by ,). first-layer storage <br /> (Only applicable if log.channel.type=mix or pmem)|
86
-
|storage.pmem.sizes|-1|pmem capacities in bytes (separated by ,); -1 means use all the space <br />(Only applicable if log.channel.type=mix or pmem)|
87
-
|storage.hdd.paths|/hdd|hdd mount paths (separated by ,). second-layer storage <br />(Only applicable if log.channel.type=mix)|
88
-
|storage.migrate.threads|1|the number of threads used for migration <br />(Only applicable if log.channel.type=mix)|
89
-
|storage.migrate.threshold|0.5|the threshold used to control when to start the migration. <br /> -1 means no migration. <br />(Only applicable if log.channel.type=mix)|
90
-
|log.channel.type|file|log file channel type. <br /> Options: "file", "pmem", "mix".<br />"file": use normal FileChannel as vanilla Kafka does <br />"pmem": use PMemChannel, which will use pmem as the log storage<br />"mix": use MixChannel, which will use pmem as the first-layer storage and hdd as the second-layer storage|
91
-
|log.pmem.pool.ratio|0.8|A pool of log segments will be pre-allocated. This is the proportion of total pmem size. Pre-allocation will increase the first startup time, but can eliminate the dynamic allocation cost when serving requests.<br />(Only applicable if log.channel.type=mix or pmem)|
85
+
|log.channel.type|file|log file channel type. <br /> Options: "file", "pmem", "tiered".<br />"file": use normal file as vanilla Kafka does <br />"pmem": use pmem as the log storage<br />"tiered": use tiered storage|
86
+
|storage.tiers.types|PMEM,HDD|the storage types for each layers (separated by ,). <br /> Available types are PMEM, NVME, SSD, HDD.|
87
+
|storage.tiers.first.paths|/pmem|first-layer storage paths (separated by ,). <br /> (Only applicable if log.channel.type=tiered or pmem)|
88
+
|storage.tiers.first.sizes|-1|first-layer storage capacities in bytes (separated by ,); -1 means use all the space <br />(Only applicable if log.channel.type=tiered or pmem)|
89
+
|storage.tiers.second.paths|/hdd|second-layer storage paths (separated by ,) <br />(Only applicable if log.channel.type=tiered)|
90
+
|storage.migrate.threshold|0.5|the threshold used to control when to start the migration. <br /> -1 means no migration. <br />(Only applicable if log.channel.type=tiered)|
91
+
|storage.migrate.threads|1|the number of threads used for migration <br />(Only applicable if log.channel.type=tiered)|
92
+
|log.pmem.pool.ratio|0.8|A pool of log segments will be pre-allocated. This is the proportion of total pmem size. Pre-allocation will increase the first startup time, but can eliminate the dynamic allocation cost when serving requests.<br />(Only applicable if we are using pmem as the first-layer storage)|
92
93
93
94
> :warning:**`log.preallocate` has to be set to `true` if pmem is used, as PMem MemoryBlock does not support `append`-like operations.**
94
95
95
96
Sample config in config/server.properties is as follows:
# if "file": use normal file as vanilla Kafka does. Following configs are not applicable.
102
+
log.channel.type=file
103
+
# the storage types for each layers (separated by ,)
104
+
storage.tiers.types=PMEM,HDD
105
+
# first-layer storage paths (separated by ,)
106
+
storage.tiers.first.paths=/pmem
107
+
# first-layer storage capacities in bytes (separated by ,); -1 means use all the space
108
+
storage.tiers.first.sizes=-1
109
+
# second-layer storage paths (separated by ,)
110
+
storage.tiers.second.paths=/hdd
111
+
# threshold to control when to start the migration; -1 means no migration.
112
+
storage.migrate.threshold=0.5
113
+
# migration threads
114
+
storage.migrate.threads=1
115
+
116
+
# pmem-specific config
117
+
# pre-allocated pool ratio
101
118
log.pmem.pool.ratio=0.8
102
-
log.channel.type=mix
103
119
# log.preallocate have to set to true if pmem is used
104
120
log.preallocate=true
105
121
122
+
######## end of tiered storage config ########
123
+
106
124
#### 3.3.3. Start Pafka
107
125
Follow instructions in https://kafka.apache.org/quickstart. Basically:
108
126
@@ -160,8 +178,7 @@ We've tested on Java 8, Java 11 and Java 15.
160
178
> WARNING: All illegal access operations will be denied in a future release
161
179
162
180
163
-
- Currently, only the log files are stored in PMem, while the indexes are still kept as normal files, as we do not see much performance gain if we move the indexes to PMem.
164
-
- Release `v0.1.x` uses PMem as the only storage device, which may limit the use for some scenarios that require a large capacity for log storage. Release `v0.2.0` addresses this issue by introducing a tiered storage strategy.
181
+
- Currently, only the log files are stored in the tiered storage, while the indexes are still kept as normal files, as we do not see much performance gain if we move the indexes to fast storage.
165
182
166
183
167
184
## 5. Roadmap
@@ -170,7 +187,7 @@ We've tested on Java 8, Java 11 and Java 15.
170
187
|---|---|---|
171
188
|v0.1.1|Released|- Use PMem for data storage <br /> - Significant performance boost compared with Kafka |
172
189
|v0.2.0|Released|- A two-layered storage strategy to utilize the total capacity of all storage devices while maintaining the efficiency by our cold-hot data migration algorithms<br /> - Further PMem performance improvement by using `libpmem`|
173
-
|v0.3.0|Q4 2021|- Configurable storage devices for both 1st and 2nd layers, to support using large SSD as the first layer |
190
+
|v0.3.0|Released|- Configurable storage devices for both 1st and 2nd layers, to support using large SSD/NVMe as the first layer |
0 commit comments