Search Preview
算法 - 海运的博客
haiyun.me海运的博客 首页 关于 分析网站 文章归档 参考手册 在线工具 常用命令
.me > haiyun.me
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Title | 算法 - 海运的博客 | ||||||||||||||||||||||||||||||||||||
Text / HTML ratio | 52 % | ||||||||||||||||||||||||||||||||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||||||||||||||||||||||||||||||||
Flash | Excellent! The website does not have any flash contents. | ||||||||||||||||||||||||||||||||||||
Keywords cloud | = booltrue this>tokens < rate private this>timestamp return function public tokens 海运的博客 this>rate this>capacity Typecho delta time Rss 文章归档 傻狍子 | ||||||||||||||||||||||||||||||||||||
Keywords consistency |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
Images | We found 1 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|---|---|
= | 12 | 0.60 % |
booltrue | 10 | 0.50 % |
this>tokens | 7 | 0.35 % |
< | 4 | 0.20 % |
rate | 4 | 0.20 % |
private | 4 | 0.20 % |
this>timestamp | 3 | 0.15 % |
return | 3 | 0.15 % |
function | 3 | 0.15 % |
public | 3 | 0.15 % |
tokens | 3 | 0.15 % |
海运的博客 | 2 | 0.10 % |
this>rate | 2 | 0.10 % |
this>capacity | 2 | 0.10 % |
Typecho | 2 | 0.10 % |
delta | 2 | 0.10 % |
time | 2 | 0.10 % |
Rss | 2 | 0.10 % |
文章归档 | 2 | 0.10 % |
傻狍子 | 2 | 0.10 % |
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|---|---|
booltrue booltrue | 8 | 0.40 % |
= rate | 3 | 0.15 % |
public function | 3 | 0.15 % |
this>tokens = | 2 | 0.10 % |
i < | 2 | 0.10 % |
this>tokens < | 2 | 0.10 % |
booltrue boolfalse | 2 | 0.10 % |
i var_dumptk>consume | 2 | 0.10 % |
< 6 | 2 | 0.10 % |
6 i | 2 | 0.10 % |
1 i | 2 | 0.10 % |
= 1 | 2 | 0.10 % |
i = | 2 | 0.10 % |
for i | 2 | 0.10 % |
= time | 2 | 0.10 % |
this>timestamp = | 2 | 0.10 % |
AutoHotKey 4 | 1 | 0.05 % |
4 OpenSSL | 1 | 0.05 % |
OpenSSL 9 | 1 | 0.05 % |
9 Sandboxie | 1 | 0.05 % |
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
booltrue booltrue booltrue | 6 | 0.30 % | No |
i < 6 | 2 | 0.10 % | No |
booltrue booltrue boolfalse | 2 | 0.10 % | No |
1 i < | 2 | 0.10 % | No |
= 1 i | 2 | 0.10 % | No |
i = 1 | 2 | 0.10 % | No |
for i = | 2 | 0.10 % | No |
6 i var_dumptk>consume | 2 | 0.10 % | No |
< 6 i | 2 | 0.10 % | No |
Firefox 13 Cygwin | 1 | 0.05 % | No |
7 Firefox 13 | 1 | 0.05 % | No |
Xshell 7 Firefox | 1 | 0.05 % | No |
Cygwin 4 OpenSSL | 1 | 0.05 % | No |
4 OpenSSL 9 | 1 | 0.05 % | No |
OpenSSL 9 Sandboxie | 1 | 0.05 % | No |
9 Sandboxie 3 | 1 | 0.05 % | No |
2 Xshell 7 | 1 | 0.05 % | No |
LNS 2 Xshell | 1 | 0.05 % | No |
1 LNS 2 | 1 | 0.05 % | No |
PE 1 LNS | 1 | 0.05 % | No |
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
booltrue booltrue booltrue booltrue | 4 | 0.20 % | No |
< 6 i var_dumptk>consume | 2 | 0.10 % | No |
i < 6 i | 2 | 0.10 % | No |
1 i < 6 | 2 | 0.10 % | No |
= 1 i < | 2 | 0.10 % | No |
i = 1 i | 2 | 0.10 % | No |
for i = 1 | 2 | 0.10 % | No |
booltrue booltrue booltrue boolfalse | 2 | 0.10 % | No |
13 Cygwin 4 OpenSSL | 1 | 0.05 % | No |
4 OpenSSL 9 Sandboxie | 1 | 0.05 % | No |
Cygwin 4 OpenSSL 9 | 1 | 0.05 % | No |
7 Firefox 13 Cygwin | 1 | 0.05 % | No |
Firefox 13 Cygwin 4 | 1 | 0.05 % | No |
9 Sandboxie 3 StrokesPlus | 1 | 0.05 % | No |
Xshell 7 Firefox 13 | 1 | 0.05 % | No |
2 Xshell 7 Firefox | 1 | 0.05 % | No |
LNS 2 Xshell 7 | 1 | 0.05 % | No |
1 LNS 2 Xshell | 1 | 0.05 % | No |
PE 1 LNS 2 | 1 | 0.05 % | No |
1 PE 1 LNS | 1 | 0.05 % | 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
算法 - 海运的博客 海运的博客 首页 关于 分析网站 文章归档 参考手册 在线工具 常用命令 流量控制限制单位时间内连接数算法 发布时间:January 11, 2015 // 分类:算法 // No Comments 有时要在服务器端控制每个IP单位时间内连接数,或在客户端限制对某个服务器单位时间内的请求数,可以使用以下算法:1.Leaky Bucket漏桶算法2.Token Bucket令牌桶算法3.使用hash ttl计数PHP实现的一个Token Bucket令牌桶算法,原理是计算上次请求时间到现在请求时间增加的令牌数,然后看令牌桶内是否有空余的令牌,每次请求后令牌减1,由于php变量生存期为脚本执行期,在应用中可将数据保存到共享内存为数据库:<?php matriculation TokenBucket { private $capacity; private $tokens; private $rate; private $timestamp; //rate为每秒限制连接数,同时初始桶大小为rate public function __construct($rate) { $this->capacity = $rate; $this->tokens = $rate; $this->rate = $rate; $this->timestamp = time(); } public function consume() { //如果令牌少于1返回false if (($tokens = $this->tokens()) < 1) { return false; } //本次请求后令牌减1 $this->tokens--; return true; } public function tokens() { $now = time(); if ($this->tokens < $this->capacity) { //计算上次请求时间到现在要增加的令牌数 $delta = $this->rate * ($now - $this->timestamp); $this->tokens = min($this->capacity, $this->tokens + $delta); } //更新请求时间 $this->timestamp = $now; return $this->tokens; } } $tk = new TokenBucket(5, 5); for ($i = 1; $i < 6; $i++) { var_dump($tk->consume()); } sleep(1); for ($i = 1; $i < 6; $i++) { var_dump($tk->consume()); } ?>输出如下:bool(true) bool(true) bool(true) bool(true) bool(true) bool(false) bool(true) bool(true) bool(true) bool(true) bool(true) bool(false) 分类 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.037秒。-->