Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / fio cheatsheet
Last active July 19, 2024 15:45
fio cheatsheet
-----------------------------------------------------------------------------------------------------
Read Test
fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting
-----------------------------------------------------------------------------------------------------
writes a total 2GB files [4 jobs x 512 MB = 2GB] running 4 processes at a time:
fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting
-----------------------------------------------------------------------------------------------------
Read Write Performance Test
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
@RagedUnicorn
RagedUnicorn / cloud_init_debugging.md
Last active May 2, 2024 14:38
Debugging tipps when working with cloud-init

Cloud-Init Debugging

Cloud-init combined with terraform can be a powerful tool to provision instances on startup. Debugging scripts that are run by cloud-init however are not the easiest to debug.

Logs

Usually on an Ubuntu machine a lot of what is happening can be found in the syslog

cat /var/log/syslog
@onyxraven
onyxraven / rds.sh
Last active June 21, 2022 13:42 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB
#/32 = 496630545 = 473MB
#/64 = 248315272 = 236MB
#/128 = 124157636 = 118MB
#/256 = 62078818 = 59MB
#/512 = 31039409 = 29MB
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762
#/25165760 = 623 # half of max_connections = 1993.6MB
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608
#*(3/4) #default innodb pool size = 11922309120
@ashchan
ashchan / gist:589094
Created September 21, 2010 02:34
NSDate class method to get an NSDate from an internet date time string (RFC822 or RFC3339)
// Return date for internet date string (RFC822 or RFC3339)
// - RFC822 http://www.ietf.org/rfc/rfc822.txt
// - RFC3339 http://www.ietf.org/rfc/rfc3339.txt
// - Good QA on internet dates: http://developer.apple.com/iphone/library/qa/qa2010/qa1480.html
// - Cocoa date formatting: http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
+ (NSDate *)dateFromInternetDateTimeString:(NSString *)dateString {
// Setup Date & Formatter
NSDate *date = nil;
static NSDateFormatter *formatter = nil;