Skip to content

Instantly share code, notes, and snippets.

View alram's full-sized avatar

Alexandre Marangone alram

  • DigitalOcean
  • CA
View GitHub Profile
#!/bin/bash
#set -x
FIO_RESULT_DIR="/home/amarangone/fio_results"
FIO_COMMON_OPTIONS="--ioengine=libaio --direct=1 --runtime=300 --iodepth=32"
for i in `ls /sys/block/ | grep ^sd `; do
#we don't want to bench a HDD with a partition table
ls /sys/block/${i}/sd* > /dev/null 2>&1
if [ $? -ne 0 ]; then
# /tmp/myobject is a 100k object
# created with:
# dd if=/dev/urandom of=/tmp/myobject bs=100k count=1
import rados
import random
import socket
#objects name: <oject-prefix>-<id>
object_prefix=socket.gethostname()
@alram
alram / crush_data_movement_calculator.py
Last active October 26, 2020 12:57
Calculate how much data will move before applying a CRUSHmap change
#!/usr/bin/env python
import ast
import json
import os
import subprocess
import argparse
import sys
FNULL = open(os.devnull, 'w')
@alram
alram / ceph_journal_migration.sh
Last active May 6, 2021 17:14
Ceph journal migration
#!/bin/bash
journal_device="/dev/sda"
osds=(0 1 2 3 4)
num_journal_part=${#osds[@]}
i=1
while [ $i -le $num_journal_part ]
do
disk_id=`uuidgen`
sgdisk --new=${i}:0:+5120M --change-name="${i}:ceph journal" --partition-guid=${i}:${disk_id} --typecode=${i}:45b0969e-9b03-4f30-b4c6-b4b80ceff106 --mbrtogpt ${journal_device}
@alram
alram / gist:3231174bc972dbacc918
Last active August 29, 2015 14:24
perf_dump_avg_latencies
import argparse
import os
import subprocess
import json
asock_path = '/var/run/ceph/'
data_type = ['osd', 'filestore']
def get_perf_values(output, type):
latency_data = {}
@alram
alram / gist:7489958
Created November 15, 2013 19:14
osd: fix bench typo
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index b67e406..c714cc7 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -4015,7 +4015,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
int64_t bsize;
// default count 1G, size 4MB
cmd_getval(g_ceph_context, cmdmap, "count", count, (int64_t)1 << 30);
- cmd_getval(g_ceph_context, cmdmap, "bsize", bsize, (int64_t)4 << 20);
+ cmd_getval(g_ceph_context, cmdmap, "size", bsize, (int64_t)4 << 20);
diff --git a/src/ceph-disk b/src/ceph-disk
index 77a9d9a..b2208fa 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -1345,6 +1345,7 @@ def move_mount(
path,
cluster,
osd_id,
+ options
):
@alram
alram / gist:4687617
Last active December 12, 2015 00:58
1) Install fcgi and mod_fastcgi RPMs for el6
# rpm -ivh fcgi-2.4.0-10.el6.x86_64.rpm
# rpm -ivh mod_fastcgi-2.4.6-2.el6.rf.x86_64.rpm
2) install ceph-radosgw
# yum install ceph-radosgw
3) Copy /etc/ceph/ceph.conf from 10.42.3.10 and add the radosgw informations
[client.radosgw.gateway]
host = rados-gw
@alram
alram / vmadm.diff
Created July 2, 2012 19:38
vmadm - support multiple cdrom options
29c29
< var VM = require('/opt/vm/node_modules/VM');
---
> var VM = require('VM');
231,238c231
< if(key === 'cdrom') {
< if(!parsed[key]) {
< parsed[key] = [];
< }
< parsed[key].push(val);
@alram
alram / vmadm.diff
Created June 27, 2012 13:32
vmadm create-json
diff --git a/src/vm/node_modules/VM.js b/src/vm/node_modules/VM.js
index 1dbbbdb..2a44fe8 100644
--- a/src/vm/node_modules/VM.js
+++ b/src/vm/node_modules/VM.js
@@ -34,6 +34,7 @@
*
* console(uuid, callback)
* create(properties, callback)
+ * create-json(file, callback)
* delete(uuid, callback)