Skip to content

Instantly share code, notes, and snippets.

View yuuki's full-sized avatar

Yuuki TSUBOUCHI yuuki

View GitHub Profile
@yuuki
yuuki / deploy.sh
Last active September 6, 2016 15:24
ISUCON deploy.sh
#!/bin/bash
set -ex
IPADDR=$1
USERNAME=$USER
ssh isucon@$IPADDR "/home/isucon/notify.sh $USERNAME 'deploying...' && cd /home/isucon/deploy && git pull && ~/.local/perl/bin/carton install && sudo systemctl restart mysql && sudo service memcached restart && sudo systemctl restart isuxi.perl && sudo systemctl restart nginx && sudo sysctl -p && /home/isucon/notify.sh $USERNAME 'deploy done'"
@yuuki
yuuki / eachfork-ab
Last active June 22, 2016 14:22
each-fork vs prefork
yuukit@syscall01:~/perl$ ab -n 100000 -c 5 http://10.240.0.7:10020/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.240.0.7 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
@yuuki
yuuki / each-fork-perl
Last active April 13, 2017 15:19
each fork vs prefork
[y_uuki@ ~]$ ab -n 5000 -c 20 http://localhost:10020/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
$ telnet yuuki.hhh 10020
Trying x.x.x.x...
Connected to yuuki.h.h.
Escape character is '^]'.
hoge
hoge
^]
#!/bin/bash
for v in $(rbenv versions --bare); do
rbenv uninstall -f $v
rbenv install $v
rbenv global $v
rbenv exec gem install capistrano --no-ri --no-rdoc --version "=2.15.5"
rbenv exec gem install git-browse-remote --no-ri --no-rdoc
done
#!/usr/bin/env python
# # Prepare test files.
# rm /tmp/test_*.wsp; for i in `seq 0 99`;do bin/whisper-create.py /tmp/test_$i.wsp 60s:25h 5m:21d 1h:90d 1d:2y; done
# Execute benchmark.
# sync; echo 3 | sudo tee /proc/sys/vm/drop_caches ; python bin/whisper-update-many-fadvice-test.py f | grep read
import random
import time
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'optparse'
require 'json'
require 'mackerel/client'
# Mackerel API Spec
## http://help-ja.mackerel.io/entry/spec/api/v0
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
my $logfile = $ARGV[0] or die "log file reuqire";
my $taken_key = $ARGV[1] || 'taken';
open(my $logfh, '<', $logfile);
package main
import (
"code.google.com/p/go-tour/tree"
"fmt"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
@yuuki
yuuki / hey.pl
Created August 29, 2013 06:26
Perlのこと何もわかってなかった。 6行目で怒られると思ってた
#!/usr/bin/env perl
use strict;
use warnings;
my $hoge = undef;
$hoge->{key} = 10;
use Data::Dumper;
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;