bigwhite / experiments Goto Github PK
View Code? Open in Web Editor NEWPersonal code, scripts and config files for experiments
Personal code, scripts and config files for experiments
你好 Tony,
I just want to ask you if GoLang is a good choice for making a programming language.
对了,我是西班牙人,但是我很喜欢中文!
谢谢你!
这一行代码 https://github.com/bigwhite/experiments/blob/master/go_timer_reset/example4.go#L31
为什么不选择使用defer写在for之前呢 比如24行的位置
望大佬解答~
添加 log.WithCaller(true) 后 caller始终是 log/log.go ,该如何解决?
按照步骤执行到
# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
details ClusterIP 10.254.98.67 <none> 9080/TCP 21h
kubernetes ClusterIP 10.254.0.1 <none> 443/TCP 21h
productpage ClusterIP 10.254.98.56 <none> 9080/TCP 21h
ratings ClusterIP 10.254.169.33 <none> 9080/TCP 21h
reviews ClusterIP 10.254.173.213 <none> 9080/TCP 21h
svca ClusterIP 10.254.104.79 <none> 80/TCP 18h
svcb ClusterIP 10.254.175.196 <none> 80/TCP 18h
在其中一个节点上执行以下命令,没有任何输出。
curl 10.254.104.79/pay
想请问您在文章中(https://tonybai.com/2018/01/03/an-intro-of-microservices-governance-by-istio/)
提到的svca和svcb的日志,个人理解应该来自于# nohup ./msgd > 1.log & 2>&1
但是查看1.log文件里内容,为空,什么都查看不到。
看到tony老板这篇文章:https://tonybai.com/2021/04/25/server-side-performance-nethttp-vs-fasthttp/
那么,在持续“饱和”请求的场景下,如何让fasthttp workerpool中goroutine的数量不会因conn的增多而线性增长呢?fasthttp官方没有给出答案,但一条可以考虑的路径是使用os的多路复用(linux上的实现为epoll),即go runtime netpoll使用的那套机制。在多路复用的机制下,这样可以让每个workerpool中的goroutine处理同时处理多个连接,这样我们可以根据业务规模选择workerpool池的大小,而不是像目前这样几乎是任意增长goroutine的数量。当然,在用户层面引入epoll也可能会带来系统调用占比的增多以及响应延迟增大等问题。至于该路径是否可行,还是要看具体实现和测试结果。
我这有个repo,主要解决golang单进程1000k问题。普通并发量的简单echo压测场景响应性能未必比标准库强,但海量并发要强很多:
https://github.com/lesismal/nbio
一些简介:https://www.v2ex.com/t/794435
http 基本兼容标准库:
https://github.com/lesismal/nbio_with_other_frameworks
只作为网络库的性能与同类repo比较:
https://github.com/lesismal/go-net-benchmark
lesismal/go-net-benchmark#1
另外,易用性远高于同类repo
首先很高兴阅读你的文章,这让新手的我至少能走出第一步。
但不知道是版本问题还是怎么,目前教程中的关于response的xml加入CDATA,你文中用的方式已经不可以了。并且还有一个bug会影响消息的返回。(因为除了CreateTime之外的字段都是空了。)
type CDATAText struct {
Value string `xml:",innerxml"`
}
// 应该替换为cdata。
type CDATAText struct {
Value string `xml:",cdata"`
}
// bug,没有return值
func value2CDATA(v string) CDATAText {
return CDATAText{}
}
// fix 后
func value2CDATA(v string) CDATAText {
return CDATAText{v}
}
controller中的函数 serviceForWebserver
, deploymentForWebserver
,是生成的还老师手写的啊?
如果是手写的,老师是怎么知道应该这么写呢?尤其是像serviceForWebserver
最后 ctrl.SetControllerReference(ws, srv, r.Scheme)
。老师是从什么地方获取的这些写法的?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.