Skip to content

Instantly share code, notes, and snippets.

@toritori0318
toritori0318 / redis-benchmark.txt
Created January 9, 2018 16:56
redis-benchmark: 4.9.58-18.55.amzn1.x86_64: c4.large: redis-2.8.24
$ redis-cli -n 1 flushdb
###############################################################################################
$ redis-benchmark --dbnum 1
====== PING_INLINE ======
100000 requests completed in 0.78 seconds
50 parallel clients
3 bytes payload
keep alive: 1
@toritori0318
toritori0318 / redis-benchmark.txt
Last active January 9, 2018 16:05
redis-benchmark: 4.9.75-25.55.amzn1.x86_64: c4.large: redis-2.8.24
$ redis-cli flushall
OK
##############################################################################################
$ redis-benchmark
====== PING_INLINE ======
100000 requests completed in 0.93 seconds
50 parallel clients
3 bytes payload
keep alive: 1
@toritori0318
toritori0318 / nginx.conf
Last active April 9, 2017 09:49
request_id 引き回し
worker_processes 1;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$_request_id"';
@toritori0318
toritori0318 / install.sh
Created September 12, 2016 16:25
tsung install for amazon linux
yum update -y
yum groupinstall -y "Development Tools"
yum install -y erlang perl perl-devel perl-Template-Toolkit openssl-devel
git clone https://github.com/processone/tsung
cd tsung
./configure && make && make install
@toritori0318
toritori0318 / nginx_for_production.conf
Last active December 29, 2021 19:04
nginx balancer example
worker_processes 1;
daemon off;
error_log /dev/stdout;
events {
worker_connections 1024;
}
http {
@toritori0318
toritori0318 / watch_event_consul.sh
Created December 8, 2015 16:33
Consulからイベント受け取ってItamae実行とか
#!/bin/sh
if [ ! -p /dev/stdin ] ; then
exit 0
fi
VM=""
RECIPE=""
# 標準入力から受け取り
STDIN_STR=$(cat -)
PAYLOAD=`echo $STDIN_STR | jq -r '.[0] .Payload' | base64 -d`
@toritori0318
toritori0318 / define.rb
Created February 14, 2015 15:49
こんな風に書きたい
define :install_and_enable_package, version: nil do
# install
action :install, :default do
package params[:name] do
version params[:version] if params[:version]
action :install
end
service params[:name] do
action :enable
end
@toritori0318
toritori0318 / entrypoint.rb
Last active August 29, 2015 14:15
itamae define再定義問題
include_recipe "./recipe1.rb"
include_recipe "./recipe2.rb"
@toritori0318
toritori0318 / isucon4_lapis_recipe.rb
Last active September 26, 2022 18:21
isucon4 Lapis版 Itamaeレシピ
# attributes
pcre_version='8.36'
openresty_version='1.7.7.1'
openresty_prefix='/opt/openresty'
luarocks_version='2.0.13'
########################################
# iscon bashrc
execute "add bashrc" do
command <<-"EOH"
@toritori0318
toritori0318 / install.sh
Last active August 29, 2015 14:10
openresty install
PCRE_VERSION=8.36
OPENRESTY_VERSION=1.7.7.1
LUAROCKS_VERSION=2.2.0
# depends
sudo yum install -y openssl-devel
# pcre
cd /tmp
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.tar.gz