Skip to content

Instantly share code, notes, and snippets.

@weldpua2008
Created August 14, 2018 08:12
Show Gist options
  • Save weldpua2008/c72077939203dcae7e617185bb40b56e to your computer and use it in GitHub Desktop.
Save weldpua2008/c72077939203dcae7e617185bb40b56e to your computer and use it in GitHub Desktop.
Redis helpful

Allocate some redis by ports to some Numa

On NUMA 0

#ps -Af|grep '/usr/bin/redis-server'|grep -v grep|grep -E ":6399|:6500|6395"|awk '{print $2}'| xargs -I {} taskset -pc $(cd  /sys/devices/system/node/node0/;ls -d cpu[0-9]*|grep -o [0-9]*|sort -n|head -4|tr '\n' ','|sed -e 's:\,$::') {}

On NUMA 1

#ps -Af|grep '/usr/bin/redis-server'|grep -v grep|grep -E ":6397|:6389|:6400|:6500"|awk '{print $2}' | xargs -I {} taskset -pc $(cd  /sys/devices/system/node/node1/||cd  /sys/devices/system/node/node0/;ls -d cpu[0-9]*|grep -o [0-9]*|sort -n|head -4|tr '\n' ','|sed -e 's:\,$::') {}

REDIS memory usage by port

echo;for port in 6399 ;do echo -n "$port "; redis-cli  -p $port info|grep used_memory_peak_human;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment