https://tyk.io/ 阿里云API网关: https://help.aliyun.com/produ …
作者存档:phpor
关于httpdns
概要 httpdns就是通过http的方式进行域名解析;阿里云有提供httpdns服务(目前2016-4-9 …
关于shell一些小知识点
关于 [[]] 和 [] 的区别 实例1: 说明: [] 和 [[]] 是不同的语法; 对于 [ 事实上, …
docker虚拟机设置固定IP
参考文章: http://www.tuicool.com/articles/v2yQ7bA 创建网桥(可以写成 …
关于网桥
为什么virtualbox网卡桥接模式下在宿主机上看不到网桥? virtualbox在后台启动了一个进程,很牛 …
dnsmasq 的一个小配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
listen-address=172.16.10.4 # If you want dnsmasq to provide only DNS service on an interface, # configure it as shown above, and then use the following line to # disable DHCP on it. #no-dhcp-interface= # On systems which support it, dnsmasq binds the wildcard address, # even when it is listening on only some interfaces. It then discards # requests that it shouldn't reply to. This has the advantage of # working even when interfaces come and go and change address. If you # want dnsmasq to really bind only the interfaces it is listening on, # uncomment this option. About the only time you may need this is when # running another nameserver on the same machine. bind-interfaces |
一个cobbler错误
在做一个yum源镜像的时候,遇到一个错误: cobbler reposync –only cent …
PHP中sessionid的那点儿事儿
PHP中默认的sessionid为PHPSESSID; 当然,也可以通过 string session_nam …
php-redis benchmark
脚本:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
<?php $pid = posix_getpid(); $host = '10.10.11.123'; $port = '6379'; $auth = 'thepassword'; $total = $slow = $fail = 0; $arr = array(); $t_start = microtime(1); for($i = 0; $i < $argv[1]; $i++) { $total++; $time_start = microtime(1); $r = new Redis(); $r->connect($host, $port, 1); $r->auth($auth); $r->select(3); $key = "test_${pid}_$i"; $val = "data_$i"; $r->set($key, $val); $v = $r->get($key); if ($v !== $val) { $fail++;continue; } $r->del($key); $time_end = microtime(1); $time_use = 1000 * ($time_end - $time_start); if ($time_use < 3) { @$arr["<3"]++; } else if ($time_use < 10) { @$arr["<10"]++; } else if ($time_use < 14) { @$arr["<14"]++; } else if ($time_use < 20) { @$arr["<20"]++; } else if ($time_use < 50) { @$arr["<50"]++; } else if ($time_use > 100) { @$arr[">100"]++; } } $t_end = microtime(1); echo "total: $total\t"; echo "fail: $fail\n"; echo "time use: ". (($t_end - $t_start) * 100) ."ms\n"; ksort($arr); printf("%4s: %6s %s(%%)\n", "ms", "count", "percent"); foreach($arr as $k=>$v) { printf("%4s: %6d %.2f%%\n", $k, $v, $v/$total*100); } |
阿里云的1G标准的re …
关于syslog协议
在使用rsyslog的时候,一般来讲,如果消息中含有换行符的话,这条消息会以换行符为分隔,视为多条消息;即: …