Skip to content

Conversation

@aronlt
Copy link

@aronlt aronlt commented Jan 25, 2016

你好,我看了WebBench的代码,发现父进程在fork子进程后,只是让子进程sleep了一秒,然后就运行子进程。如果client的数量比较大的话,可能在1s内有的子进程还没有fork出来,前面的子进程就已经运行了,这样会导致测试的并发进程数和输入的参数不一致,不知道我的想法有没有错误。

@AnSwErYWJ
Copy link
Contributor

你好, 我做了下实验,按照最大30000并发,发现fork完所有的子进程大约需要0.5s左右,1s是足够的.
不过看了您的建议,发现确实您提出的方法更加灵活,不过是否测过激活第一个子进程到激活最后一个子进程,大约需要多少时间呢,按照最大并发30000测试?

webbench.c Outdated
}
/*record child pid*/
pids[i]=pid;
sleep(1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep(1) each loop in father process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants