Skip to content

Instantly share code, notes, and snippets.

View tobert's full-sized avatar
💭
🏳️‍🌈 💻 🏳️‍🌈

Amy Tobey tobert

💭
🏳️‍🌈 💻 🏳️‍🌈
View GitHub Profile
# enable assertions. disabling this in production will give a modest
# performance benefit (around 5%).
JVM_OPTS="$JVM_OPTS -ea"
# min and max heap sizes should be set to the same value to avoid
# stop-the-world GC pauses during resize, and so that we can lock the
# heap in memory on startup to prevent any of it from being swapped
# out.
JVM_OPTS="$JVM_OPTS -Xms${MAX_HEAP_SIZE}"
JVM_OPTS="$JVM_OPTS -Xmx${MAX_HEAP_SIZE}"
@tobert
tobert / 65536.txt
Created September 10, 2015 01:07
Amp
Results:
op rate : 1981 [simple:1981]
partition rate : 1981 [simple:1981]
row rate : 1981 [simple:1981]
latency mean : 64.6 [simple:64.6]
latency median : 40.4 [simple:40.4]
latency 95th percentile : 150.0 [simple:150.0]
latency 99th percentile : 185.3 [simple:185.3]
latency 99.9th percentile : 308.0 [simple:308.0]
latency max : 633.2 [simple:633.2]
@tobert
tobert / rar_buffer_size.diff
Created September 9, 2015 17:42
Make Cassandra's RandomAccessReader buffer size configurable, default to the old value.
diff --git a/src/java/org/apache/cassandra/io/util/RandomAccessReader.java b/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
index 95877a2..47b4b9b 100644
--- a/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
+++ b/src/java/org/apache/cassandra/io/util/RandomAccessReader.java
@@ -31,6 +31,7 @@ public class RandomAccessReader extends RandomAccessFile implements FileDataInpu
// default buffer size, 64Kb
public static final int DEFAULT_BUFFER_SIZE = 65536;
+ public static final int BUFFER_SIZE = getBufferSize();
@tobert
tobert / 100r.txt
Last active September 1, 2015 05:53
A little thing I'm working on...
Results:
op rate : 7741 [READ:7741]
partition rate : 7741 [READ:7741]
row rate : 7741 [READ:7741]
latency mean : 103.3 [READ:103.3]
latency median : 79.6 [READ:79.6]
latency 95th percentile : 217.7 [READ:217.7]
latency 99th percentile : 347.9 [READ:347.9]
latency 99.9th percentile : 515.7 [READ:515.7]
latency max : 977.7 [READ:977.7]
@tobert
tobert / ycsb.yaml
Created August 3, 2015 18:06
ycsb-like config for cassandra-stress
# cassandra-stress user profile=ycsb.yaml
# Just a first pass. Needs some tweaking.
keyspace: ycsb
keyspace_definition: |
CREATE KEYSPACE ycsb WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
table: small
@tobert
tobert / pin-compaction.sh
Last active August 29, 2015 14:26
Pin Apache Cassandra compaction threads to a core
#!/bin/bash
# A quick & dirty script to pin compaction threads to a core without
# any consideration for HT or what kind of compaction any given thread
# is doing.
# atobey@datastax.com 2015-08-02
# match all processes with nice value 4, which is hard-coded in Cassandra
pids=$(ps -eLo nice,tid,args |awk '/^ *4 .*java/{print $2}')
ncores=$(grep ^processor /proc/cpuinfo |wc -l)
@tobert
tobert / env.sh
Last active November 27, 2022 08:53
cassandra-env.sh excerpt to *disable* JMX security
# jmx: metrics and administration interface
#
# add this if you're having trouble connecting:
# JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<public name>"
myip=$(ip -4 addr show eno1 |awk '/inet /{ gsub(/\/[0-9]+/, ""); print $2 }')
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=$myip"
#
# see
@tobert
tobert / smartctl-a-hdd
Created July 7, 2015 21:10
smartctl -a on an HDD and SSD
atobey@brak ~ $ sudo smartctl -a /dev/sda
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-4.0.1-1-ARCH] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST9500430SS
Revision: DS04
User Capacity: 500,107,862,016 bytes [500 GB]
Logical block size: 512 bytes
atobey@brak ~ $ sudo ioping -c 10 -S 4k -D /mnt/sdg
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=1 time=391 us
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=2 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=3 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=4 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=5 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=6 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=7 time=8.62 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=8 time=8.63 ms
4 KiB from /mnt/sdg (xfs /dev/sdg1): request=9 time=8.93 ms
Ran on a 15 node cluster. 6GB heap with 2GB offheap memtables, G1GC, and jemalloc.
Small is 16 cols. Medium is 30 cols. Large is 60 cols wide. All 3 ran simultaneously from 2 client nodes running cassandra-stress.