[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Bufferevent client read callback sporadically not called
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] Bufferevent client read callback sporadically not called
- From: Alexander Klauer <alexander.klauer@xxxxxxxxxxxxxx>
- Date: Fri, 11 May 2012 11:07:57 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 11 May 2012 05:08:05 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4l+ApSI6+RQhRQLcKsj5zHZexAIs2/wG50qpat+X534=; b=w7EN4eCEgaNRRKL7J2f5VNmZVEFUHFJBSPVAi4cNije2dvPeTQWKW0eAtnWrDNojpZ oZ/mFrzCP/MOtfz1As7QS89z7E++Q8P8tzUyZLXxxDfkslHTMSa19erqibr0FJHzo607 9d3V8wn+FsOTudqnCutBKdaLdnBBZh65+ii1IYzij0jctxqmOAcNdlR1jDIaLe/Cl0Cs yXGaj+cDLlIDmQPu1hjHCn76opzFGhgQOC/KyWJIxjGoXWYbb2uE2R9ZbPCUZjYcNpAV 1sj7Zi3jea4voqoxL2/J9qh8vnH0UAsFoqpqZ340q6jLCICoc4PeepNqJMFHt8hyaheN TvtA==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
I'm new to libevent and have the following problem with bufferevents.
I have a server talking to many clients. Very occasionally (when the
number of clients is around 1000 or larger), the server writes a
message to the client, which is read by the client (strace shows that
readv() is successfully called) but the read callback of the client is
not invoked. Subsequently, both server and client side of the
connection wait for input in epoll_wait() until timeout.
The problem exhibits itself with libevent 2.0.16, 2.0.19 and the 2.1.1
alpha. I'm using a default event base (level-triggered I/O) with
default watermarks. Surely, I must be making a simple mistake
somewhere, like introducing a race condition, but I can't find it.
I made a simple program which demonstrates the behaviour:
http://pastebin.com/FaCuCwU5
Compile with gcc -std=gnu99 -Wall -pedantic test.c -levent and run
with ./a.out [number of clients].
For me, with 500 clients, everything is fine, while with 1000 clients,
a few connections stall. Make sure you set your file descriptor limit
sufficiently high.
Any help is appreciated.
Best regards,
Alexander
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.