Open
Conversation
Contributor
|
你好, 我做了下实验,按照最大30000并发,发现fork完所有的子进程大约需要0.5s左右,1s是足够的. |
xjf-zxcr
reviewed
May 6, 2017
webbench.c
Outdated
| } | ||
| /*record child pid*/ | ||
| pids[i]=pid; | ||
| sleep(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
你好,我看了WebBench的代码,发现父进程在fork子进程后,只是让子进程sleep了一秒,然后就运行子进程。如果client的数量比较大的话,可能在1s内有的子进程还没有fork出来,前面的子进程就已经运行了,这样会导致测试的并发进程数和输入的参数不一致,不知道我的想法有没有错误。