Skip to content

Instantly share code, notes, and snippets.

use warnings;
use strict;
use Encode qw/from_to _utf8_off/;
use Net::Google::Spreadsheets;
my $user='id';
my $pass='pass';
my $service = Net::Google::Spreadsheets->new(
username => $user,

予選

  • Amazon Machine Image (以下AMI) から起動したインスタンスを1台利用
  • 使用するインスタンスタイプは m3.xlarge (EBS最適化なし) とする。他のインスタンスタイプを使用した場合の結果は無効とする。
  • 各参加チームが自分のAWSアカウントでそのマシンイメージを起動
  • 出題者側で発行したAPI key(文字列) を入力してベンチマークツールを設定
  • 予選終了までは出題内容を他者に漏らさないこと

予選レギュレーション

以下変更不可

  • アクセス先のURI (IPアドレスおよびパス(複数))

スロークエリをオンラインで調査する

mysql> set global slow_query_log = 1;
mysql> set global slow_query_log_file = '/tmp/slowquery.log';
mysql> set global long_query_time = 0; # 0秒にセットすると全queryをロギング

ダンプしたデータを解析

@nikushi
nikushi / redis-isucon.md
Created November 5, 2013 14:24
redis関連メモ

インストール

amazon aimなら

sudo yum --enablerepo=epel install redis

2.4.10がインストールされる

起動

画像が表示されバージョン

Client < GF
HTTP/1.0 200 OK                                 
Date: Mon, 02 Dec 2013 05:44:30 GMT             
Server: Plack::Handler::Starlet                 
Content-Type: image/png                         
X-Frame-Options: DENY                           
X-XSS-Protection: 1                             
X-Powered-By: GrowthForecast/0.62               
@nikushi
nikushi / trace-the-place-to-add-content-length.md
Last active December 29, 2015 23:59
GF->rack-streaming-proxy->webrickのレスポンスストリームで、GFからわたってきたチャンクデータをwebrickがContent-Lenghtヘッダを付けてしまう。
[242, 261] in /Users/nikushi.nobuhiro/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/webrick/httpresponse.rb
   242:       if @status == 304 || @status == 204 || HTTPStatus::info?(@status)
   243:         @header.delete('content-length')
   244:         @body = ""
   245:       elsif chunked?
   246:         @header["transfer-encoding"] = "chunked"
   247:         @header.delete('content-length')
   248:       elsif %r{^multipart/byteranges} =~ @header['content-type']
   249:         @header.delete('content-length')

dump http response by curl --trace

curl web-server directly terminator is "0d 0a". Response is normal and correct!

<= Recv data, 10398 bytes (0x289e)
0000: 32 38 39 31 0d 0a 89 50 4e 47 0d 0a 1a 0a 00 00 2891...PNG......
0010: 00 0d 49 48 44 52 00 00 01 ce 00 00 00 ba 08 02 ..IHDR..........
0020: 00 00 00 a8 40 3a 84 00 00 00 06 62 4b 47 44 00 ....@:.....bKGD.
0030: ff 00 ff 00 ff a0 bd a7 93 00 00 20 00 49 44 41 ........... .IDA
@nikushi
nikushi / chunk-test.md
Last active December 30, 2015 02:39
Transfer-Encoding: chunkedを返答するときでもWebRickだとContent-Lengthが付いてしまう

WebRick

$ telnet localhost 9292
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
Host: localhost:9292
105         ensure
106           if req.request_line
107             if req.keep_alive? && res.keep_alive?
108               req.fixup()
109             end
110             res.send_response(sock)
111             server.access_log(@config, req, res)
112           end
113 end
@nikushi
nikushi / fluentd-multi-process-start-log.md
Created December 5, 2013 08:55
Multiprocess Input Pluginの起動ログ
$ fluentd -c fluent/fluentd.conf
2013-12-05 08:45:29 +0000 [info]: starting fluentd-0.10.41
2013-12-05 08:45:29 +0000 [info]: reading config file path="fluent/fluentd.conf"
2013-12-05 08:45:29 +0000 [info]: gem 'fluent-plugin-multiprocess' version '0.1.0'
2013-12-05 08:45:29 +0000 [info]: gem 'fluentd' version '0.10.41'
2013-12-05 08:45:29 +0000 [info]: using configuration file: <ROOT>
  <source>
    type multiprocess
    <process>