Entries from 2013-01-01 to 1 year
Define $ENV{SERVER_STARTER_PORT} in your script. if (-S $socket) { warn "removing existing socket file:$socket"; unlink $socket or die "failed to remove existing socket file:$socket:$!"; } unlink $socket; my $sock = IO::Socket::UNIX->new( …
使う事があるかどうかは置いといて、使えた package MyApp::Web; .. # request/response use Kossy::Request; use Kossy::Response; sub create_request { Kossy::Request->new($_[1]) } sub create_response { shift; Kossy::Response->new(@_) } メリット…
社内で少し話題になったので。運用上の話はfujiwaraさんのMySQLをmaster:slave=1:1構成にして参照をslaveに向けるのがなぜ良くないか - 酒日記 はてな支店 MySQLで参照の負荷分散を行うslaveは3台から構成するのがよいのでは - 酒日記 はてな支店をみてくだ…
Starlet-0.21がリリースされました。Starlet-0.21 - a simple, high-performance PSGI/Plack HTTP server - metacpan.org - Perl programming languageこのバージョンからServer::Staterとの組み合わせでUNIX domain socketをListenすることができるようにな…
ISUCON3 の予選AMIが公開されてから、ごにょごにょとHackした結果、スコアで65000まで出す事ができました。(一回だけ66000でけどたぶんインスタンスガチャ)「ISUCON 本戦出場者決定のお知らせ」をみると予選の時のトップのスコアが3.3万(自分たちは1.5万ぐら…
I want to automate CPAN.pm configuration on Travis. I wrote .travis.yaml like this language: perl before_install: - cpanm -n CPAN - (echo y;echo y;echo o conf commit)|cpan - cpanm -n Module::Install Module::Install::Repository Module::Inst…
I released Kossy-0.24-Trial. It contains new request-body parser Kossy::BodyParser.https://metacpan.org/release/KAZEBURO/Kossy-0.24-TRIALKossy::BodyParser is based on tokuhirom's Plack::BodyParser https://github.com/plack/Plack/pull/434I t…
セッション管理モジュールやルーティングライブラリが速くなる事で何もしなくても isucon3 予選のperlのアプリケーションが高速化していく— masahiro nagano (@kazeburo) October 10, 2013ということで、やってみた。 初期 「オンライン予選で使用した問題が…
Monoceros-0.26 uses sendfile(2) for sending file if Sys::Sendfile is available.https://metacpan.org/release/MonocerosPlack::Middleware::Static::OpenFileCache can cache opened file handles like nginx's open_file_cache. Static::OpenFileCache…
English document is available on metacpan! Plack::Middleware::Session::Simpleをリリースしました。Plack::Middleware::Session(Store::Cache & State::Cookie)と互換性を保ちながら、効率よく動作することを狙っています。 必要なときに必要なだけ Set-…
I released Kossy::Validator to CPAN. It was separated from Kossyhttps://metacpan.org/release/Kossy-ValidatorYou can use Kossy::Validator modules w/o Kossy.ぜひ毎日通って下さいww RT @mackee_w: Kossy::Validator分離してくだされ〜〜〜〜〜〜〜…
I added get_or_set() to Cache::Memcached::Fast::Safe and released as ver. 0.04https://metacpan.org/release/Cache-Memcached-Fast-SafeI saw some people make a module that inherits Cache::Memcached::Fast::Safe only for adding get_or_set(). sa…
Kossy-0.23 gets 2x or more faster. https://metacpan.org/release/KossyI made these changes. Cache Kossy::Request->base. URI->canonical is slow. Use Router::Boom for router Use HTTP::Headers::Fast Optimize Kossy::Response->finalize Benchmark…
Plack::Middleware::Session 0.21 uses Cookie::Baker for improve performance. Cookie::Baker is simple cookie generator/parser module. https://metacpan.org/release/Plack-Middleware-SessionPrevious version of Plack::Middleware::Session uses Pl…
I released Cookie::Baker that provides HTTP cookie generator and parserhttp://search.cpan.org/~kazeburo/Cookie-Baker/ https://metacpan.org/release/Cookie-Baker### synopsis use Cookie::Baker; $headers->push_header('Set-Cookie', bake_cookie(…
tokuhirom released Linux::Socket::Accept4 that provides accept4(2) Monoceros-0.25 uses accept4 if Linux::Socket::Accept4 is avaliable.accept4(2) can set FD_CLOEXEC and O_NONBLOCK in one system call.Monoceros-0.24 select(16, [4 10], NULL, N…
isucon3予選に @sugyan @tagomorisとLINE選抜チームを組んで参加しました。共催枠なので結果に関わらず本戦には出れるのですが、結果は総合8位。無念です やったこと sugyanのエントリが詳しいのですが、自分がやったのは nginx(openresty)への入れ替え mysq…
I decided to downgrade memcached because there was trouble several times in 1.4.15. After downgrading to 1.4.14, the memcached keeps item 7% more than 1.4.15.1.4.15 has a bug around slab allocator? ref: https://code.google.com/p/memcached/…
I want to output "Vary: Accept-Encoding,User-Agent". But gzip_vary only adds Accept-Encoding. "add_header Vary" does not merge headers.My answer is.. location / { gzip on; gzip_disable "MSIE [1-6]\."; gzip_types text/css application/x-java…
最近、新しいサーバでサービスを動かしたりベンチマークを取る場合には、モリスさんのxbuildを使ってるhttps://github.com/tagomoris/xbuildxbuildを使うとローカルの任意のディレクトリにPerl(Ruby,Node.js,PHP,Pythonにも対応)のランタイムを設置してくれ…
I released Plack::Middleware::ServerStatus::Lite 0.30. This version includes `server-status` command.https://metacpan.org/release/Plack-Middleware-ServerStatus-Liteserver-status command is able to display server status without HTTP request…
I released Cache::Memcached::Fast::Safe 0.03 to cpanhttps://metacpan.org/module/Cache::Memcached::Fast::Safeversion 0.02 has a connection leaking bug. Please update if you use this.
Preforking Plack::Handler, Starlet and Monoceros reached 100kreq/sec on my "Hello World" benchmark. Starlet $ plackup -s Starlet -E produnction --max-workers 40 --max-reqs-per-child 50000 \ -max-keepalive-reqs 10000 -e 'sub{[200,[],["Hello…
Plack $ no_proxy=www.cpan.org http_proxy=http://localhost:3941 cpanm --test-only MIYAGAWA/Plack-1.0028.tar.gz --> Working on MIYAGAWA/Plack-1.0028.tar.gz Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Plack-1.0028.tar.gz ... OK Conf…
PSGI/Plack HTTP server Starlet 0.20 that was released last week, supports HTTP/1.1.https://metacpan.org/release/Starlet https://github.com/kazuho/StarletPrevious versions of Starlet only support HTTP/1.0 and HTTP/1.0 keepalive, but finally…
Secrets
Cache::Memcached::Fast::Safe is subclass of Cache::Memcached::Fast. Cache::Memcached::Fast::Safe sanitizes all requested keys for against memcached injection problem. and call disconnect_all automatically after fork for fork-safe.https://m…
proclet command (foreman for perl) that included in Proclet distribution, now supports auto assignment of $PORT that written in Procfile.https://metacpan.org/release/ProcletIn Procfile web: plackup -p $PORT -a app.psgi admin: plackup -p $P…
In Server::Starter 0.13, --dir option was added to start_server. start_server will do chdir to a specified directory before exec(2). It's useful when you use carton, proclet and deploy tool like capistrano that does rsync all project files…
AnyEvent::HTTPの続き package MyFurl::HTTP; use strict; use warnings; use base qw/Furl::HTTP/; use Time::HiRes; sub response_time { if ( @_ > 1 ) { $_[0]->{times} = $_[1]; } $_[0]->{times}; } sub connect : method { my($self, $host, $port, $…