提交 f474a5bd 编写于 作者: D Didier Spezia 提交者: Pieter Noordhuis

Add wait states to deal with many connections.

上级 1cd3c1e0
......@@ -278,11 +278,22 @@ static client createClient(int replytype) {
}
static void createMissingClients(client c) {
int n = 0;
while(config.liveclients < config.numclients) {
client new = createClient(c->replytype);
new->obuf = sdsdup(c->obuf);
if (config.randomkeys) randomizeClientKey(c);
/* Listen backlog is quite limited on most systems */
if (++n > 64) {
usleep(50000);
n = 0;
}
}
/* Start the timer once the connection are established */
config.start = mstime();
}
static int compareLatency(const void *a, const void *b) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册