Skip to content

Instantly share code, notes, and snippets.

@jdurgin
jdurgin / osd_op_latency.py
Created March 27, 2023 16:39
osd op latency
#!/usr/bin/python3
from datetime import datetime
import re
import sys
class Transaction(object):
def __init__(self, tid, start):
self.tid = tid
self.start = start
@jdurgin
jdurgin / dequeue_op_latency.py
Created May 6, 2021 21:19
script to extract timestamp and dequeue latency for ops from an osd log
#!/usr/bin/python
from datetime import datetime
import re
import sys
class Op(object):
def __init__(self, line):
self.lat = float(re.search('latency (\d+.\\d+)', line).group(1))
self.line = line
@jdurgin
jdurgin / ceph-release-notes
Created May 4, 2021 23:31
use py3 strings to avoid b'' around output
#!/usr/bin/env python
# Originally modified from A. Israel's script seen at
# https://gist.github.com/aisrael/b2b78d9dfdd176a232b9
"""To run this script first install the dependencies
virtualenv v
source v/bin/activate
pip install githubpy GitPython requests
@jdurgin
jdurgin / reset_branch.py
Created April 13, 2021 18:15
reset_branch.py
#!/usr/bin/env python
# do a `pip install githubpy` before running the script
import os
import github
import argparse
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("target_sha", metavar="target_sha",
#!/usr/bin/env python
# Originally modified from A. Israel's script seen at
# https://gist.github.com/aisrael/b2b78d9dfdd176a232b9
"""To run this script first install the dependencies
virtualenv v
source v/bin/activate
pip install githubpy GitPython requests
@jdurgin
jdurgin / options.txt
Last active May 23, 2023 07:58
hdd/ssd-tuned options in nautilus
Option("osd_op_num_threads_per_shard_hdd", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(1)
.set_flag(Option::FLAG_STARTUP)
.set_description("")
.add_see_also("osd_op_num_threads_per_shard"),
--
Option("osd_op_num_threads_per_shard_ssd", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(2)
.set_flag(Option::FLAG_STARTUP)
.set_description("")
@jdurgin
jdurgin / osd_wallclock_profile.txt
Created September 3, 2020 22:55
4k random write osd wallclock profile
Thread: 1 (ceph-osd) - 1000 samples
+ 100.00% main
+ 100.00% AsyncMessenger::wait
+ 100.00% std::condition_variable::wait(std::unique_lock<std::mutex>&)
+ 100.00% pthread_cond_wait@@GLIBC_2.3.2
Thread: 2 (log) - 1000 samples
+ 100.00% clone
@jdurgin
jdurgin / last_thread.py
Created July 18, 2020 01:36
finding the last line logged for each thread in ceph logs
#!/usr/bin/python
import sys
def main(args):
filename = args[1]
threads = dict()
with open(filename, 'r') as f:
for line in f.readlines():
threadid = line.split(' ')[2]
@jdurgin
jdurgin / Dockerfile
Last active January 18, 2022 19:48
building ceph in containers
FROM quay.io/ceph-ci/ceph:master
ADD ceph.spec.in /bootstrap/ceph.spec.in
ADD install-deps.sh /bootstrap/install-deps.sh
# ceph repo for the installed sha1 may no longer exist - basing this on a plain centos container would probably make more sense
RUN dnf config-manager --set-disabled Ceph Ceph-noarch ceph-source
RUN dnf install -y git virtualenv
RUN /bin/bash -c 'cd /bootstrap && ./install-deps.sh'
RUN rm -rf /bootstrap
@jdurgin
jdurgin / gist:f8f8b007d325ce9c424086b6a2dc0b69
Created October 21, 2019 20:42
Mark's onode trimming simple patch
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc
index e1b7325..e7631e8 100644
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ -851,16 +851,21 @@ void BlueStore::LRUCache::_trim(uint64_t onode_max, uint64_t buffer_max)
break;
} else {
p--;
- num--;