V2EX LT 的所有回复 第 1 页 / 共 4 页
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX    LT    全部回复第 1 页 / 共 4 页
回复总数  66
1  2  3  4  
2018-06-20 17:45:54 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
没有阻塞额。。。直接在 go func 外层定义变量, 里层接收值就可以了,
2018-06-20 17:37:31 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
@dishonest 看这个 issue 解释 kataras/iris/issues/463 然后,测试下 上一条回复的代码
2018-06-20 17:36:32 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
func test(ctx context.Context) {
c := make(chan int)
fmt.Println("start")
go func(){
// 等待 10 秒
time.Sleep(time.Duration(5) * time.Second)
c <- 0
}()
<- c
fmt.Println("end")
ctx.Text("test")
}
2018-06-20 17:30:43 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
2018-06-20 17:21:30 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
```
func test(ctx context.Context) {
go func(){
fmt.Println("start")

// 等待 10 秒
time.Sleep(time.Duration(10) * time.Second)

fmt.Println("end")

ctx.Text("test")
}()
}

```
2018-06-20 17:21:08 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
time.sleep 是主线程休眠,你要模拟延迟响应应该写盗 go func(){}里面
2018-06-20 16:48:45 +08:00
回复了 lauix 创建的主题 程序员 GO 如何实现 页面非阻塞?
其实我更好奇你写出的阻塞代码。每个 http 请求本来就是独立的啊
2018-06-13 17:05:55 +08:00
回复了 lueffy 创建的主题 Go 编程语言 go 语言中 类型声明/类型别名 的作用何在?
@Y4ssss 赞同
2018-06-13 17:04:34 +08:00
回复了 shustone 创建的主题 数据库 个人博客数据库你们是怎么设计的啊?
2016-07-18 13:53:05 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
添加一些 ip 到防火墙后, iptables 的规则里面没有相应 ip, iptables -L 的结果是:
DROP all -- bzq-79-178-9-254.red.bezeqint.net anywhere
DROP all -- cable-24-135-138-230.dynamic.sbb.rs anywhere
DROP all -- 105-226-148-3.east.dsl.telkomsa.net anywhere
DROP all -- host-41.238.20.42.tedata.net anywhere
DROP all -- 188.228.36.184.dynamic.altibox.net anywhere
DROP all -- 91.204.60.100.cn.zp.ua anywhere

这些都是动态 vps 吧?
2016-07-18 12:07:26 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@7654 不是,游戏攻略,资讯类的。。
2016-07-18 12:06:52 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@realpg 朋友上班业务搞的网站。。哪来的专业运维。。。 另外一个写前端 js 的懂个毛线 php (笑 cry )
2016-07-18 11:30:4 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
错误日志里面有很多条这个

connect() to unix:/dev/shm/php-cgi.sock failed(12: Cannot allocate memory)....

这个是内存泄露的意思么
2016-07-18 11:22:00 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@suckli 好多 ip 。。
2016-07-18 11:18:45 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
这是一部分 错误日志, 当把网站打开的时候 就狂刷
r from upstream, client: 180.253.54.101, server: www.jx3pve.com, request: "GET http://www.jx3pve.com/ HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock", host: "www.jx3pve.com", referrer: "http://www.jx3pve.com/"
2016/07/18 10:57:23 [error] 26013#0: *8028 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 180.253.54.101, server: www.jx3pve.com, request: "GET http://www.jx3pve.com/ HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock", host: "www.jx3pve.com", referrer: "http://www.jx3pve.com/"
2016/07/18 10:57:24 [error] 26013#0: *8060 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 180.253.54.101, server: www.jx3pve.com, request: "GET http://www.jx3pve.com/ HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock", host: "www.jx3pve.com", referrer: "http://www.jx3pve.com/"
2016/07/18 10:57:24 [error] 26013#0: *8081 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 180.253.54.101, server: www.jx3pve.com, request: "GET http://www.jx3pve.com/ HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock", host: "www.jx3pve.com", referrer: "http://www.jx3pve.com/"
2016/07/18 10:57:24 [error] 26016#0: *8097 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 180.253.54.101, server: www.jx3pve.com, request: "GET http://www.jx3pve.com/ HTTP/1.1", upstream: "fastcgi://unix:/dev/shm/php-cgi.sock", host: "www.jx3pve.com", referrer: "http://www.jx3pve.com/"
2016-07-18 11:16:36 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
然后 ps aux 不知道这么多 进程是否正常

www 26502 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26503 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26504 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26505 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26506 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26507 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26508 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26509 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26510 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26511 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26512 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26513 0.0 0.1 393684 5284 ? S 10:59 0:00 php-fpm: pool www
www 26514 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26515 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26516 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26517 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26519 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26521 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26522 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26523 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26525 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26527 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26528 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26529 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26531 0.0 0.1 393684 5288 ? S 10:59 0:00 php-fpm: pool www
www 26533 0.0 0.1 393684 5292 ? S 10:59 0:00 php-fpm: pool www
www 26535 0.0 0.1 393684 5292 ? S 10:59 0:00 php-fpm: pool www
www 26537 0.0 0.1 393684 5292 ? S 10:59 0:00 php-fpm: pool www
www 26539 0.0 0.1 393684 529 ? S 10:59 0:00 php-fpm: pool www
www 26540 0.0 0.1 393684 5292 ? S 10:59 0:00 php-fpm: pool www
www 26541 0.0 0.1 393684 5292 ? S 10:59 0:00 php-fpm: pool www
2016-07-18 11:14:45 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@Silicon 我试试 感谢
2016-07-18 11:12:28 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@ershisi 抓过包了 很多 ip , status 499. 上了 阿里云的 web 防火墙 还是不行。
2016-07-18 11:11:43 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@asp jx3pve.com 现在我已经把它停掉了
2016-07-18 11:11:22 +08:00
回复了 LT 创建的主题 程序员 服务器被黑好蛋疼 ...记录下 随便求助
@dxwwym 游戏网址日均 pv 30w-50w 左右
1  2  3  4  
关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     864 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 16ms UTC 21:32 PVG 05:32 LAX 14:32 JFK 17:32
Do have faith in what you're doing.
ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86