
一 | HONG KONG -- A Washington state senator was arrested in Hong Kong for carrying a gun that was not registered in the semi-autonomous Chinese city, his website and local media reported. He was released on bail on Monday.Jeff Wilson, a Republican from Longview, was arrested after landing at the Hong Kong International Airport on Saturday. Wilson was traveling with his wife for a five-week vacation in Southeast Asia, his website said. His gun was not registered in the financial hub but is registered in Washington, the statement added. According to Hong Kong’s public broadcaster RTHK, Wilson appeared in court Monday to face the charge of possession of arms without a license and was granted bail. “It was an honest mistake, and I expect the situation to be resolved shortly,” he was quoted as saying on his website. It said Wilson's next hearing is due on Oct. 30. After Monday's hearing at the Shatin Magistrates’ Courts, Wilson had to surrender his travel documents, the local newspaper The Standard reported. It said the next hearing will take place at the West Kowloon Magistrates’ Courts. Hong Kong's Customs and Excise Department declined to comment as legal proceedings are ongoing. Under Hong Kong law, it is illegal to carry a firearm without a license. Offenders face a fine of up to 100,000 Hong Kong dollars ($12,800) and can be sentenced to up to 14 years if convicted. However, typically the Magistrates' Courts grant a maximum two-year sentence for cases they handle, the judiciary's website said. According to Wilson's website, he had discovered the weapon mid-flight between San Francisco and Hong Kong and reported it to customs authorities on landing.。
一键部署OpenClaw 服务器CPU莫名飙高,带宽跑满,看日志全是同一个IP一秒打来几十个请求——这不是业务火了,是被CC了。扛CC的第一道闸门不在代码里,在Nginx的限流模块里,配置成本几乎为零。 limit_req的原理是漏桶:你设定一个速率,超速的请求直接返回503或延迟排队。先用limit_req_zone定义一个计数区,再在location里挂上limit_req,两步完事。
# nginx.conf 的 http 块里定义限流区 # 以客户端IP为key,10MB内存可存约16万个IP状态 # rate=10r/s 表示平均每秒最多放行10个请求 limit_req_zone $binary_remote_addr zone=req_per_ip:10m rate=10r/s; # server 或 location 块里应用 server { location / { limit_req zone=req_per_ip burst=20 nodelay; proxy_pass http://127.0.0.1:8080; } } burst=20是缓冲队列长度,配合nodelay表示突发20个请求立即处理、不排队,超出就直接拒。想对登录、搜索这类昂贵接口管得更严,单独再定义一个rate=2r/s的zone挂上去就行,互不影响。 # 对登录接口单独限流:每秒2个,突发5个
limit_req_zone $binary_remote_addr zone=login_limit:10m rate=2r/s;
location /login.php {
limit_req zone=login_limit burst=5 nodelay;
# 被限流的请求返回429而不是默认503
limit_req_status 429;
fastcgi_pass 127.0.0.1:9000;
} 验证很简单:reload之后用ab压一下,ab -n 200 -c 20 https://你的域名/,看返回里有没有429或503;同时tail -f日志确认正常用户没被误伤。限流阈值别拍脑袋定,先统计自己站点的正常峰值,设成峰值的两倍左右再逐步收紧。
二 | 限流是防守,如果卡死自己人就本末倒置了。 数据来源:nginx.org官方文档 ngx_http_limit_req_module 模块说明
申请创业报道,分享创业好点子。点击此处,共同探讨创业新机遇!。
Current article:http://4n0.panningbuquanchencaibingzhang.cyou/list_t095q7/59r4ev7.html
Published on:17:26:50
新闻热点
新闻爆料
图片精选
点击排行