Skip to content

Instantly share code, notes, and snippets.

View kenn's full-sized avatar

Kenn Ejima kenn

View GitHub Profile
@kenn
kenn / gist:5228906
Last active February 15, 2016 07:16
DigitalOcean per-core pricing

CPU Price Performance: DigitalOcean vs Linode

On DigitalOcean, as you go up the plan, you get higher per-core price as well.

https://www.digitalocean.com/pricing

$5 1 core     - $5/core
$10 1 core - $10/core
@kenn
kenn / gist:5191853
Last active December 15, 2015 03:08
# hdparm -tf /dev/xvda
/dev/xvda:
Timing buffered disk reads: 714 MB in 3.01 seconds = 237.55 MB/sec
# bonnie++ -b -u root
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
@kenn
kenn / gist:5191215
Last active December 15, 2015 02:59
# hdparm -tf /dev/xvda
/dev/xvda:
Timing buffered disk reads: 638 MB in 3.03 seconds = 210.52 MB/sec
# bonnie++ -b -u root
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
@kenn
kenn / gist:5105175
Last active December 14, 2015 15:08
Unicorn memory usage improvement with Ruby 2.0.0

Unicorn memory usage improvement with Ruby 2.0.0

Here's a preliminary experiment to see how much memory is saved with the new copy-on-write friendly (bitmap marking) GC.

Calculated by memstats.rb https://gist.github.com/kenn/5105061 on Debian x86_64.

Master process:

# ./memstats.rb 20547
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@kenn
kenn / gist:4742470
Last active December 12, 2015 08:18
DigitalOcean 512 with Virtio: Disk I/O benchmark using bonnie++
# hdparm -tf /dev/vda
/dev/vda:
Timing buffered disk reads: 2102 MB in 3.00 seconds = 700.08 MB/sec
# bonnie++ -b -u root
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
@kenn
kenn / gist:4741999
Last active December 12, 2015 08:08
DigitalOcean 512: Disk I/O benchmark using bonnie++
# hdparm -tf /dev/sda
/dev/sda:
Timing buffered disk reads: 1208 MB in 3.01 seconds = 401.59 MB/sec
# bonnie++ -b -u root
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
require 'securerandom'
module Syllable
CONSONANT = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr lt)
VOWEL = %w(a e i o u y)
def generate(size=2)
"".tap do |result|
(size * 2).times do |i|
result << (i.even? ? CONSONANT[SecureRandom.random_number * CONSONANT.size] : VOWEL[SecureRandom.random_number * VOWEL.size])
@kenn
kenn / gist:4711250
Created February 5, 2013 01:07
DigitalOcean unixbench result 16G
========================================================================
BYTE UNIX Benchmarks (Version 5.1.2)
System: konami-slot: GNU/Linux
OS: GNU/Linux -- 2.6.32-5-amd64 -- #1 SMP Sun May 6 04:00:17 UTC 2012
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: QEMU Virtual CPU version 1.0 (4000.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 1: QEMU Virtual CPU version 1.0 (4000.0 bogomips)
@kenn
kenn / gist:4553954
Last active December 11, 2015 05:39
DigitalOcean unixbench results
========================================================================
BYTE UNIX Benchmarks (Version 5.1.2)
System: kenn: GNU/Linux
OS: GNU/Linux -- 2.6.32-5-686-bigmem -- #1 SMP Sun May 6 04:39:05 UTC 2012
Machine: i686 (unknown)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: QEMU Virtual CPU version 1.0 (4000.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET, Intel virtualization
05:12:14 up 9 min, 1 user, load average: 0.20, 0.09, 0.02; runlevel 2