mirror of
https://github.com/wassname/ray.git
synced 2026-09-12 12:51:15 +08:00
Put object store memory on /dev/shm on linux (#89)
* put object store memory on /dev/shm on linux * fix * fix mac
This commit is contained in:
committed by
Robert Nishihara
parent
dd39008532
commit
03324caffc
@@ -147,7 +147,13 @@ def start_objstore(node_ip_address, redis_address, cleanup=True):
|
|||||||
"""
|
"""
|
||||||
# Compute a fraction of the system memory for the Plasma store to use.
|
# Compute a fraction of the system memory for the Plasma store to use.
|
||||||
system_memory = psutil.virtual_memory().total
|
system_memory = psutil.virtual_memory().total
|
||||||
plasma_store_memory = int(system_memory * 0.75)
|
if sys.platform == "linux" or sys.platform == "linux2":
|
||||||
|
# On linux we use /dev/shm, its size is half the size of the physical
|
||||||
|
# memory. To not overflow it, we set the plasma memory limit to 0.4 times
|
||||||
|
# the size of the physical memory.
|
||||||
|
plasma_store_memory = int(system_memory * 0.4)
|
||||||
|
else:
|
||||||
|
plasma_store_memory = int(system_memory * 0.75)
|
||||||
# Start the Plasma store.
|
# Start the Plasma store.
|
||||||
plasma_store_name, p1 = plasma.start_plasma_store(plasma_store_memory=plasma_store_memory, use_profiler=RUN_PLASMA_STORE_PROFILER)
|
plasma_store_name, p1 = plasma.start_plasma_store(plasma_store_memory=plasma_store_memory, use_profiler=RUN_PLASMA_STORE_PROFILER)
|
||||||
# Start the plasma manager.
|
# Start the plasma manager.
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ int create_buffer(int64_t size) {
|
|||||||
(DWORD)(uint64_t) size, NULL)) {
|
(DWORD)(uint64_t) size, NULL)) {
|
||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#ifdef __linux__
|
||||||
|
static char template[] = "/dev/shm/plasmaXXXXXX";
|
||||||
#else
|
#else
|
||||||
static char template[] = "/tmp/plasmaXXXXXX";
|
static char template[] = "/tmp/plasmaXXXXXX";
|
||||||
|
#endif
|
||||||
char file_name[32];
|
char file_name[32];
|
||||||
strncpy(file_name, template, 32);
|
strncpy(file_name, template, 32);
|
||||||
fd = mkstemp(file_name);
|
fd = mkstemp(file_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user