- proxy する前に ngx_mruby で認証したい
- ngx_mruby は master を clone
- nginx は nginx/1.7.6
#!/usr/bin/env ruby | |
require 'ox' | |
require 'benchmark' | |
require 'builder' | |
NO_SUCH_KEY_CODE = 'NoSuchKey'.freeze | |
NO_SUCH_KEY_MESSAGE = 'The specified key does not exist.'.freeze | |
@code = NO_SUCH_KEY_CODE |
#include <linux/module.h> | |
#include <linux/debugfs.h> | |
#include <linux/sched.h> | |
#include <linux/pid.h> | |
#include <asm-generic/uaccess.h> | |
MODULE_AUTHOR("hiroya"); | |
MODULE_DESCRIPTION("debugfs preempt_count"); | |
MODULE_LICENSE("GPL"); |
[vagrant@vagrant-centos65 ~]$ cat /proc/4451/stack | |
[<ffffffff8111f96d>] sync_page+0x3d/0x50 | |
[<ffffffff8111f907>] __lock_page+0x67/0x70 | |
[<ffffffff8111fc30>] __lock_page_or_retry+0x20/0xc0 | |
[<ffffffff8114affc>] handle_pte_fault+0xa9c/0xb00 | |
[<ffffffff8114b28a>] handle_mm_fault+0x22a/0x300 | |
[<ffffffff8114b48a>] __get_user_pages+0x12a/0x430 | |
[<ffffffff8114b829>] get_user_pages+0x49/0x50 | |
[<ffffffff8114b947>] __access_remote_vm+0x117/0x1f0 | |
[<ffffffff8114ba7b>] access_process_vm+0x5b/0x80 |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $packages = shift or die "[usage] $0"; | |
print `rpm -q $packages`; | |
exit; |
#!/bin/bash | |
# | |
# here is an original code: | |
# http://serverfault.com/questions/173999/dump-a-linux-processs-memory-to-file | |
# | |
function extract_memory_region() | |
{ | |
pid=$1 | |
grep rw-p /proc/${pid}/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | |
} |
perf 計測生データ | |
* perf record -p <pid> で profile を取る | |
* bash と sshd を対象とする | |
* sshd は TCPソケットでホストOSからのパケットを受け取ってシェルプロンプトに文字を書くのを請け負っている | |
* ネットワーク割り込みが直接関係するのは、たぶん、sshd | |
* エンターキー押しっぱなし、適当なキーを押しっぱなしにしてる状態の profile を取る |
VirtualBox + CentOS6.5 + Mac OSX (Mavericks) で シェルのキー操作が遅いのを調べてる
ここに書いたネタの続き http://d.hatena.ne.jp/hiboma/20140318
perf top -p <sshd>
でシェルプロンプトを表示しているプロセスを perf