Search Preview
消息队列 - 海运的博客
haiyun.me海运的博客 首页 关于 分析网站 文章归档 参考手册 在线工具 常用命令
.me > haiyun.me
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Title | 消息队列 - 海运的博客 | ||||||||||||||||||||||||||||||||||||
Text / HTML ratio | 61 % | ||||||||||||||||||||||||||||||||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||||||||||||||||||||||||||||||||
Flash | Excellent! The website does not have any flash contents. | ||||||||||||||||||||||||||||||||||||
Keywords cloud | = key end local return max content keys id function make install outmap echo cd == Comments res queue_get_value httpsqs_output_value | ||||||||||||||||||||||||||||||||||||
Keywords consistency |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
Images | We found 1 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|---|---|
= | 58 | 2.90 % |
key | 25 | 1.25 % |
end | 21 | 1.05 % |
local | 19 | 0.95 % |
return | 16 | 0.80 % |
max | 13 | 0.65 % |
content | 10 | 0.50 % |
keys | 10 | 0.50 % |
id | 10 | 0.50 % |
function | 9 | 0.45 % |
make | 9 | 0.45 % |
install | 8 | 0.40 % |
outmap | 6 | 0.30 % |
echo | 6 | 0.30 % |
cd | 6 | 0.30 % |
== | 6 | 0.30 % |
Comments | 5 | 0.25 % |
res | 5 | 0.25 % |
queue_get_value | 5 | 0.25 % |
httpsqs_output_value | 4 | 0.20 % |
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|---|---|
key = | 12 | 0.60 % |
if not | 8 | 0.40 % |
content = | 6 | 0.30 % |
then return | 6 | 0.30 % |
local key | 6 | 0.30 % |
= 1 | 5 | 0.25 % |
end return | 5 | 0.25 % |
max = | 5 | 0.25 % |
keys = | 4 | 0.20 % |
local keys | 4 | 0.20 % |
= inmapkey | 4 | 0.20 % |
make install | 4 | 0.20 % |
make make | 4 | 0.20 % |
id = | 4 | 0.20 % |
tar zxvf | 4 | 0.20 % |
outmap local | 4 | 0.20 % |
return ktRVSUCCESS | 4 | 0.20 % |
ktRVSUCCESS end | 4 | 0.20 % |
port 1978 | 4 | 0.20 % |
No Comments | 4 | 0.20 % |
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
local key = | 6 | 0.30 % | No |
key = inmapkey | 4 | 0.20 % | No |
分类:消息队列 No Comments | 4 | 0.20 % | No |
make make install | 4 | 0.20 % | No |
local keys = | 4 | 0.20 % | No |
outmap local key | 4 | 0.20 % | No |
return ktRVSUCCESS end | 4 | 0.20 % | No |
preg_split'\n' content 1 | 3 | 0.15 % | No |
= preg_split'\n' content | 3 | 0.15 % | No |
content = preg_split'\n' | 3 | 0.15 % | No |
local value = | 3 | 0.15 % | No |
content 1 PREG_SPLIT_NO_EMPTY | 3 | 0.15 % | No |
2014 分类:消息队列 No | 3 | 0.15 % | No |
end key = | 3 | 0.15 % | No |
return ktRVEINTERNAL end | 3 | 0.15 % | No |
= stringformats key | 2 | 0.10 % | No |
keys do local | 2 | 0.10 % | No |
port 1978 127001 | 2 | 0.10 % | No |
max = 1 | 2 | 0.10 % | No |
= 1 end | 2 | 0.10 % | No |
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
local key = inmapkey | 4 | 0.20 % | No |
outmap local key = | 4 | 0.20 % | No |
content = preg_split'\n' content | 3 | 0.15 % | No |
preg_split'\n' content 1 PREG_SPLIT_NO_EMPTY | 3 | 0.15 % | No |
= preg_split'\n' content 1 | 3 | 0.15 % | No |
2014 分类:消息队列 No Comments | 3 | 0.15 % | No |
keys do local key | 2 | 0.10 % | No |
do local key = | 2 | 0.10 % | No |
local key = keys | 2 | 0.10 % | No |
key = keys local | 2 | 0.10 % | No |
= keys local value | 2 | 0.10 % | No |
keys local value = | 2 | 0.10 % | No |
< 1 then max | 2 | 0.10 % | No |
key = stringformats\t key | 2 | 0.10 % | No |
= 1 keys do | 2 | 0.10 % | No |
if not max or | 2 | 0.10 % | No |
tonumbermax if not max | 2 | 0.10 % | No |
= tonumbermax if not | 2 | 0.10 % | No |
key id if not | 2 | 0.10 % | No |
tcrmgr ext port 1978 | 2 | 0.10 % | No |
Internal links in - haiyun.me
关于 - 海运的博客
分析网站 - 海运的博客
文章归档 - 海运的博客
参考手册 - 海运的博客
在线工具 - 海运的博客
常用命令 - 海运的博客
centos repo管理使用 - 海运的博客
centos/debian自动通过网络远程安装系统配置脚本 - 海运的博客
IPXE网络引导通过kickstart和preseed自动安装centos/ubuntu/debian系统 - 海运的博客
使用kickstart安装ubuntu - 海运的博客
Centos/linux ipv4优先 - 海运的博客
海运的博客
海运的博客
海运的博客
海运的博客
海运的博客
PHP - 海运的博客
IIS - 海运的博客
Mail - 海运的博客
DNS - 海运的博客
Cacti - 海运的博客
Squid - 海运的博客
Nagios - 海运的博客
Puppet - 海运的博客
CentOS - 海运的博客
Iptables - 海运的博客
RADIUS - 海运的博客
OpenWrt - 海运的博客
DD-WRT - 海运的博客
VMware - 海运的博客
网站程序 - 海运的博客
备份存储 - 海运的博客
常用软件 - 海运的博客
日记分析 - 海运的博客
Linux基础 - 海运的博客
欧诺代理 - 海运的博客
Linux服务 - 海运的博客
系统监控 - 海运的博客
流量监控 - 海运的博客
虚拟化 - 海运的博客
伪静态 - 海运的博客
LVM - 海运的博客
Shell - 海运的博客
高可用 - 海运的博客
数据库 - 海运的博客
FreeBSD - 海运的博客
网络安全 - 海运的博客
Windows - 海运的博客
网络工具 - 海运的博客
控制面板 - 海运的博客
系统调优 - 海运的博客
Cisco - 海运的博客
VPN - 海运的博客
ROS - 海运的博客
Vim - 海运的博客
KMS - 海运的博客
PXE - 海运的博客
Mac - 海运的博客
Git - 海运的博客
PE - 海运的博客
LNS - 海运的博客
Xshell - 海运的博客
Firefox - 海运的博客
Cygwin - 海运的博客
OpenSSL - 海运的博客
Sandboxie - 海运的博客
StrokesPlus - 海运的博客
AutoHotKey - 海运的博客
Total Commander - 海运的博客
WordPress - 海运的博客
iMacros - 海运的博客
Typecho - 海运的博客
Ollydbg - 海运的博客
Photoshop - 海运的博客
正则 - 海运的博客
Debian - 海运的博客
Python - 海运的博客
NoSQL - 海运的博客
消息队列 - 海运的博客
JS - 海运的博客
Tmux - 海运的博客
GO - 海运的博客
HHVM - 海运的博客
算法 - 海运的博客
Docker - 海运的博客
initrd.img解压与打包 - 海运的博客
qq smtp 465/587端口区别 - 海运的博客
Haiyun.me Spined HTML
消息队列 - 海运的博客 海运的博客 首页 关于 分析网站 文章归档 参考手册 在线工具 常用命令 使用Gearman搭建分布式任务分发平台 发布时间:January 9, 2014 // 分类:消息队列 // No Comments 使用yum直接安装:yum install gearmand安装PHP扩展:yum install libgearman re2c wget http://pecl.php.net/get/gearman-1.1.2.tgz tar zxvf gearman-1.1.2.tgz cd gearman-1.1.2 phpize ./configure make && make install reverberate "extension=gearman.so" >> /etc/php.ini启动任务分发进程:gearmand -d --keepalive --libtokyocabinet-file /tmp/gearmand.tchPHP客户端,提交任务:<?php $client= new GearmanClient(); $client->addServer("127.0.0.1", 4730); //发送任务到Job,处理函数和数据 //echo $client->do("reverse", "Hello World!"); reverberate $client->doBackground("reverse", "Hello World!"); ?> PHP执行端:<?php $worker= new GearmanWorker(); $worker->addServer("127.0.0.1", 4730); //处理接收到数据的回调函数 $worker->addFunction("reverse", "reverse_function"); while ($worker->work()); function reverse_function($job) { for($i = 0; $i < 10; $i++){ sleep(1); reverberate "{$i}\n"; } return $job->workload(); } ?> Kyoto Cabinet和LevelDB实现任务队列 发布时间:January 7, 2014 // 分类:消息队列 // No Comments 根据Tokyo Tyrant自带的Lua队列脚本修改,Kyoto Cabinet和Tokyo Tyrant的API有很大不同。kt = __kyototycoon__ db = kt.db -- 记录日志 if kt.thid == 0 then kt.log("system", "the Lua script has been loaded") end -- 入队列 function enqueue(inmap, outmap) local key = inmap.key local value = inmap.value --队列值自增1,空从0开始 local id = db:increment_double(key, 1) if not id then return kt.RVEINTERNAL end key = string.format("%s-%012d", key, id) if not db:add(key, value) then return kt.RVEINTERNAL end outmap[key] = "ok" return kt.RVSUCCESS end -- 出队列 function dequeue(inmap, outmap) local key = inmap.key local max = inmap.max max = tonumber(max) if not max or max < 1 then max = 1 end key = string.format("%s-", key) --匹配队列前缀,返回多个匹配的key local keys = db:match_prefix(key, max) local res = "" for i = 1, #keys do local key = keys[i] local value = db:get(key) if db:remove(key) and value then --要返回的结果 outmap[keys[i]] = value end end return kt.RVSUCCESS end -- 查看队列大小 function queuesize(inmap, outmap) local key = inmap.key key = string.format("%s-", key) local keys = db:match_prefix(key) outmap.size = #keys return kt.RVSUCCESS end -- 重置队列ID从0开始 function queuereset(inmap, outmap) local key = inmap.key if not key then return kt.RVEINVALID end if not db:remove(key) then local err = db:error() if err:code() == kt.Error.NOREC then return kt.RVELOGIC end return kt.RVEINTERNAL end return kt.RVSUCCESS end使用:ktremotemgr script -host 192.168.1.3 -port 1978 enqueue key queue value value1 ktremotemgr script -host 192.168.1.3 -port 1978 dequeue key queue max 10 flourish "http://192.168.1.3:1978/rpc/play_script?name=enqueue&_key=queue&_value=value1" flourish "http://192.168.1.3:1978/rpc/play_script?name=dequeue&_key=queue&_max=10" Tokyo Tyrant和Tokyo Cabinet实现任务队列 发布时间:January 7, 2014 // 分类:消息队列 // No Comments Tokyo Tyrant官方提供的Lua脚本扩展:-- 入队列 function enqueue(key, value) --通过队列名为key记录入队列的尾部,自加1为当次入队列的起始ID local id = _adddouble(key, 1) if not id then return nil end --队列key格式为队列名称\t加12位数字 key = string.format("%s\t%012d", key, id) if not _putkeep(key, value) then return nil end return "ok" end -- 出队列 function dequeue(key, max) max = tonumber(max) if not max or max < 1 then max = 1 end key = string.format("%s\t", key) --匹配队列前缀,返回匹配的多个key local keys = _fwmkeys(key, max) local res = "" for i = 1, #keys do local key = keys[i] local value = _get(key) --删除要出队列的key并返回队列值 if _out(key) and value then res = res .. value .. "\n" end end return res end -- 查看队列大小 function queuesize(key) key = string.format("%s\t", key) local keys = _fwmkeys(key) //队列数组大小 return #keys endtcrmgr ext -port 1978 127.0.0.1 enqueue myqueue value1 tcrmgr ext -port 1978 127.0.0.1 dequeue myqueue 10通过TT入队列:<?php function dequeue(){ $tt = new TokyoTyrant("localhost", '1978'); $content = $tt -> ext('dequeue', '0', 'queue', 10); $content = preg_split('/\n/', $content, -1, PREG_SPLIT_NO_EMPTY); return $content; } //队列名称 $file = 'file.csv'; $queuename = 'queue'; $tt = new TokyoTyrant("localhost", '1978'); $content = file_get_contents($file); $content = preg_split('/\n/', $content, -1, PREG_SPLIT_NO_EMPTY); //分割字符串为数组 //队列开始ID //print_r($content); foreach($content as $key => $value) { if ($key !== '') { $tmpvalue = explode(',',$value); preg_match_all("/[0-9]{1}/", $tmpvalue[0], $arrNum, PREG_SET_ORDER); if (count($arrNum) > 8) { $tt->ext('enqueue','0', $queuename, $value ); //echo $value."\n"; } } } ?>大数据通过TC PHP扩展入队列:<?php //队列名称 $file = 'file.txt'; $queuename = 'queue'; $db = new TCHDB(); $db->open('/var/queue/db.tch', TCHDB::OWRITER | TCHDB::OCREAT); $content = file_get_contents($file); $content = preg_split('/\n/', $content, -1, PREG_SPLIT_NO_EMPTY); //分割字符串为数组 //队列开始ID $id = 1; //print_r($content); foreach($content as $key => $value) { if ($key !== '') { $id = sprintf('%012d', $id); //echo $key.$value."\n"; $db->put("$queuename-$id", $value); $id++; } } $db->out($queuename); ?> Debian7安装队列服务HTTPSQS 发布时间:December 31, 2013 // 分类:消息队列 // No Comments talent install gcc make zlib1g-dev libbz2-dev yum install gcc zlib-devel bzip2-develwget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz tar zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-stable/ ./configure --prefix=/usr/local/libevent-2.0.21-stable/ make && make install cd ../ wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz tar zxvf tokyocabinet-1.4.48.tar.gz cd tokyocabinet-1.4.48/ ./configure --prefix=/usr/local/tokyocabinet-1.4.48/ make && make install cd ../ wget http://httpsqs.googlecode.com/files/httpsqs-1.7.tar.gz tar zxvf httpsqs-1.7.tar.gz cd httpsqs-1.7/ sed -i 's/12/21/g' Makefile sed -i 's/47/48/g' Makefile make && make install修改源码添加出多个队列支持:/* 出多个队列 */ else if (strcmp(httpsqs_input_opt, "mget") == 0 && httpsqs_input_num >= 0 && httpsqs_input_num <= 10000) { int i; for( i=0; i<httpsqs_input_num; i++ ) { int queue_get_value = 0; queue_get_value = httpsqs_now_getpos((char *)httpsqs_input_name); if (queue_get_value == 0) { evbuffer_add_printf(buf, "%s", "HTTPSQS_GET_END"); break; } else { char queue_name[300] = {0}; /* 队列名称的总长度,用户输入的队列长度少于256字节 */ sprintf(queue_name, "%s:%d", httpsqs_input_name, queue_get_value); char *httpsqs_output_value; httpsqs_output_value = tcbdbget2(httpsqs_db_tcbdb, queue_name); if (httpsqs_output_value) { memset(queue_name, '\0', 300); sprintf(queue_name, "%d", queue_get_value); evhttp_add_header(req->output_headers, "Pos", queue_name); evbuffer_add_printf(buf, "%s\n", httpsqs_output_value); free(httpsqs_output_value); } else { evbuffer_add_printf(buf, "%s", "HTTPSQS_GET_END"); break; } } } }源码分析:将队列读取点和写入点保存为key:queue:getpos/putpos的值,队列内容key为queue:1/queue:2形式 通过httpsqs_read_putpos获取写入/读取点值 读取队列内容时httpsqs_now_read_pos对值判断及更新值,对key:queue:+1 通过tcbdbput2/tcbdget2写入/读取队列内容更多:http://blog.s135.com/httpsqs/ 分类 Apache (13)Nginx (42)PHP (83)IIS (8)Mail (17)DNS (14)Cacti (14)Squid (5)Nagios (4)Puppet (7)CentOS (13)Iptables (23)RADIUS (3)OpenWrt (40)DD-WRT (1)VMware (9)网站程序 (3)备份存储 (11)常用软件 (20)日记分析 (10)Linux基础 (18)欧诺代理 (2)Linux服务 (18)系统监控 (4)流量监控 (7)虚拟化 (28)伪静态 (2)LVM (3)Shell (18)高可用 (2)数据库 (16)FreeBSD (3)网络安全 (25)Windows (35)网络工具 (22)控制面板 (3)系统调优 (10)Cisco (3)VPN (5)ROS (20)Vim (14)KMS (4)PXE (2)Mac (1)Git (1)PE (1)LNS (2)Xshell (7)Firefox (13)Cygwin (4)OpenSSL (9)Sandboxie (3)StrokesPlus (1)AutoHotKey (4)Total Commander (2)WordPress (3)iMacros (6)Typecho (2)Ollydbg (1)Photoshop (1)正则 (3)Debian (3)Python (8)NoSQL (6)消息队列 (4)JS (7)Tmux (3)GO (7)HHVM (2)算法 (1)Docker (2) 最新文章 centos repo管理使用centos/debian自动通过网络远程安装系统配置脚本使用kickstart安装ubuntuCentos/linux ipv4优先BT/utorrent连接加密及标志IPXE网络引导通过kickstart和preseed自动安装centos/ubuntu/debian系统ubuntu 通过ppa源安装最新版qbittorrentinitrd.img解压与打包libtorrent提高上传速度qq smtp 465/587端口区别 最近回复 404NTF: 交叉编译的作用是? 404NTF: 请教一下 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go ... 小智: 安利个PHP开发以太坊区块链的教程: http://xc.hubwiz.com/course/... 陈浩南: 您好,您教程中的 dev.openwrt.org.cn 现在似乎不可用了。请问现在应该在哪里下... 斑马斑马: 怎么查看虚拟机CPU 内存使用情况 zzg: http://downloads.openwrt.org.cn/PandoraBox/rali... xiongrui: 看图 傻狍子: filebrowser好像和这功能一样? https://github.com/filebro... 陶国文: 想看看能不能安装 傻狍子: 服务端设置了用户名密码认证的话,在openwrt的openvpn客户端的配置文件当中该如何更改... Copyright © 2011 海运的博客 / 文章归档 / Archives Rss / Comments Rss / Powered By Typecho 页面执行耗时:0.0398秒。-->