Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: IO Wait如何解决 #524

Open
3 tasks done
Fgaoxing opened this issue Jan 7, 2024 · 3 comments
Open
3 tasks done

[Question]: IO Wait如何解决 #524

Fgaoxing opened this issue Jan 7, 2024 · 3 comments
Labels
help wanted Extra attention is needed needs investigation needs more info question Further information is requested waiting for response waiting for the response from commenter

Comments

@Fgaoxing
Copy link

Fgaoxing commented Jan 7, 2024

Actions I've taken before I'm here

  • I've thoroughly read the documentations about this problem but still have no answer.
  • I've searched the Github Issues/Discussions but didn't find any similar problems that have been solved.
  • I've searched the internet for this problem but didn't find anything helpful.

Questions with details

这是基于gnet的一个http框架https://github.com/fast-response/fast-response
我在使用如下代码测试时,到打一定数量时日志不再输出,但结束时出现服务端出现IO Wait

package main

import (
    "github.com/panjf2000/ants/v2"
    "net/http"
)

func main() {
    // 创建一个协程池,最大协程数10000
    p, _ := ants.NewPool(1000000)  // 并发数
    for i := 0; i < 1000000; i++ { // 执行个数
        p.Submit(func() {
            for {
                http.Get("目标")
            }
        })
    }
}

其中输出日志,使用go关键字了,是否和这个有关

Code snippets (optional)

No response

@Fgaoxing Fgaoxing added help wanted Extra attention is needed question Further information is requested labels Jan 7, 2024
@panjf2000
Copy link
Owner

有没有服务端的具体堆栈信息或者日志?还有,有没有尝试查看进程的 TCP 连接是否全都销毁了,或者还有残存?

@Fgaoxing
Copy link
Author

@panjf2000 应该是都没有,目前我怀疑是我写的日志输出,创建了新的goroutines,由于fmt.Println造成阻塞导致超出上限,不过现在我这里没有可以提供给你的日志,所以需要等后天,(最后,谢谢大佬的回复)

@Fgaoxing
Copy link
Author

另外TLS功能什么时候能够使用,我希望是我的框架支持HTTPS和2/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs investigation needs more info question Further information is requested waiting for response waiting for the response from commenter
Projects
None yet
Development

No branches or pull requests

2 participants