Skip to content

Instantly share code, notes, and snippets.

5701 openat(AT_FDCWD, "/var/log/mysqld.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 37
5701 close(37) = 0
5701 openat(AT_FDCWD, "/var/log/mysqld.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 37
5701 close(37) = 0
5701 open("./", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 37
5701 close(37) = 0
5701 close(38) = 0
5701 close(4) = 0
5701 openat(AT_FDCWD, "./binlog.index", O_RDWR|O_CREAT, 0640) = 4
5701 openat(AT_FDCWD, "./binlog.~rec~", O_RDWR|O_CREAT, 0640) = 37
@oranie
oranie / ysaku-lie.py
Created January 17, 2020 08:00
ysaku-lie.py
# -*- coding: utf-8 -*-
import difflib
str1 = u"配られたカードで勝負するしかないのさ、それがどういう意味であれ"
str2 = u"配られたカードで勝負するっきゃないのさ、それがどうゆう意味であれ"
s = difflib.SequenceMatcher(None, str1, str2).ratio()
[ec2-user@ip-172-31-31-57 ~]$ sudo yum install td-agent-3.3.0-1.amazon2018.03.x86_64.rpm
Loaded plugins: priorities, update-motd, upgrade-helper
Examining td-agent-3.3.0-1.amazon2018.03.x86_64.rpm: td-agent-3.3.0-1.amazon2018.03.x86_64
Marking td-agent-3.3.0-1.amazon2018.03.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package td-agent.x86_64 0:3.3.0-1.amazon2018.03 will be installed
--> Processing Dependency: redhat-lsb-core for package: td-agent-3.3.0-1.amazon2018.03.x86_64
--> Running transaction check
---> Package redhat-lsb-core.x86_64 0:4.0-7.14.amzn1 will be installed
VERSION="3.2.0"
CPU=`grep processor /proc/cpuinfo | wc -l`
sudo yum -y install openssl-devel libxml2-devel gcc gcc-c++ ruby22-devel git patch vim readline-devel rpm-build autoconf htop
sudo update-alternatives --set ruby /usr/bin/ruby2.2
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
source .bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
+ bin/omnibus build td-agent3
[CLI] I | 2018-11-19T07:44:22+00:00 | Using config from 'omnibus.rb'
[Software: config_guess] W | 2018-11-19T07:44:23+00:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be available for this version.
Building td-agent 3.2.1...
[Software: preparation] I | 2018-11-19T07:44:23+00:00 | Resolving manifest entry for preparation
[NullFetcher: preparation] I | 2018-11-19T07:44:23+00:00 | Fetching `preparation' (nothing to fetch)
[Software: config_guess] I | 2018-11-19T07:44:23+00:00 | Resolving manifest entry for config_guess
[Software: config_guess] W | 2018-11-19T07:44:23+00:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be available for this version.
[Software: config_guess] W | 2018-11-19T07:44:23+00:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be available for t
[ec2-user@ip-172-31-0-174 ~]$ cat ./build.sh
VERSION="3.2.0"
CPU=`grep processor /proc/cpuinfo | wc -l`
sudo yum -y install openssl-devel libxml2-devel gcc gcc-c++ ruby22-devel git patch vim readline-devel rpm-build autoconf htop
sudo update-alternatives --set ruby /usr/bin/ruby2.2
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
source .bash_profile
@oranie
oranie / gist:d2e065fe9d464225398b35711b7d0977
Created April 27, 2018 02:55
ubuntu 14.04 docker benchmark result
ubuntu@ip-172-31-29-86:~/memtier_benchmark$ sudo docker run --rm memtier_benchmark -s oranie-mem.ab0uwo.cfg.apne1.cache.amazonaws.com -p 11211 -P memcache_binary -- threads 1 -c 20000 --test-time=60 --ratio=1:10 --data-size- list=100000:60,500000:30,100000:10 --key-prefix=memtier-memtier-memtier- --key- maximum=100000
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 2%, 0 secs] 4 threads: 46874 ops, 47099 (avg: 47099) ops/sec, 1.91MB/sec (avg: 1.91MB/sec), 4.23 (avg: [RUN #1 5%, 1 secs] 4 threads: 93274 ops, 46387 (avg: 46742) ops/sec, 1.88MB/sec (avg: 1.90MB/sec), 4.30 (avg: [RUN #1 7%, 2 secs] 4 threads: 139866 ops, 46580 (avg: 46688) ops/sec, 1.89MB/sec (avg: 1.90MB/sec), 4.30 (avg: [RUN #1 9%, 3 secs] 4 threads: 187824 ops, 47945 (avg: 47003) ops/sec, 1.94MB/sec (avg: 1.91MB/sec), 4.17 (avg: [RUN #1 12%, 4 secs] 4 threads: 234567 ops, 46731 (avg: 46948) ops/sec, 1.89MB/sec (avg: 1.90MB/sec), 4.27 (avg:
@oranie
oranie / gist:6b4f0c236b7850c6fe0a8ec071716011
Created April 23, 2018 11:37
amazon linux m4.large test
[ec2-user@ip-172-31-28-226 memtier_benchmark]$ sudo docker run --rm memtier_benchmark -s oranie-mem.ab0uwo.cfg.apne1.cache.amazonaws.com -p 11211 -P memcache_binary -- threads 1 -c 20000 --test-time=60 --ratio=1:10 --data-size- list=100000:60,500000:30,100000:10 --key-prefix=memtier-memtier-memtier- --key- maximum=100000
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 2%, 0 secs] 4 threads: 42402 ops, 42561 (avg: 42561) ops/sec, 1.73MB/sec (avg: 1.73MB/sec), 4.69 (avg: 4.69) msec la[RUN #1 4%, 1 secs] 4 threads: 84889 ops, 42475 (avg: 42518) ops/sec, 1.72MB/sec (avg: 1.73MB/sec), 4.70 (avg: 4.69) msec la[RUN #1 6%, 2 secs] 4 threads: 127292 ops, 42390 (avg: 42475) ops/sec, 1.72MB/sec (avg: 1.72MB/sec), 4.71 (avg: 4.70) msec la[RUN #1 8%, 3 secs] 4 threads: 169788 ops, 42481 (avg: 42476) ops/sec, 1.72MB/sec (avg: 1.72MB/sec), 4.70 (avg: 4.70) msec la[RUN #1 11%, 4 secs] 4 threads: 212492 ops, 42668 (avg: 425
@oranie
oranie / gist:79c03157097a7a5ca28015d70f734586
Created April 23, 2018 10:50
memtier_benchmark test実行
[ec2-user@ip-172-31-28-226 memtier_benchmark]$ ./memtier_benchmark -s oranie-mem.ab0uwo.cfg.apne1.cache.amazonaws.com -p 11211 -P memcache_binary -- threads 1 -c 20000 --test-time=60 --ratio=1:10 --data-size- list=100000:60,500000:30,100000:10 --key-prefix=memtier-memtier-memtier- --key- maximum=100000
[RUN #1] Preparing benchmark client...
[RUN #1] Launching threads now...
[RUN #1 100%, 39 secs] 4 threads: 1993880 ops, 75826 (avg: 50389) ops/sec, 3.08MB/sec (avg: 2.04MB/sec), 2.64 (avg: 3.97) msec latenc[RUN #1 100%, 39 secs] 0 threads: 2000000 ops, 75826 (avg: 50450) ops/sec, 3.08MB/sec (avg: 2.05MB/sec), 2.64 (avg: 3.96) msec latency
4 Threads
50 Connections per thread
10000 Requests per thread
[ec2-user@ip-172-31-30-60 omnibus-td-agent]$ bin/omnibus build td-agent2
[CLI] I | 2016-10-06T05:19:19+00:00 | Using config from 'omnibus.rb'
[Software: config_guess] W | 2016-10-06T05:19:20+00:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be available for this version.
Building td-agent 2.3.3...
[Software: preparation] I | 2016-10-06T05:19:20+00:00 | Resolving manifest entry for preparation
[NullFetcher: preparation] I | 2016-10-06T05:19:20+00:00 | Fetching `preparation' (nothing to fetch)
[Software: config_guess] I | 2016-10-06T05:19:20+00:00 | Resolving manifest entry for config_guess
[Software: config_guess] W | 2016-10-06T05:19:20+00:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be available for this version.
[Software: config_guess] W | 2016-10-06T05:19:20+00:00 | Version master for software config_guess was not parseable. Comparison methods such