Richter, Jörg | 4 Feb 2009 16:48
Picon

Hang with Solaris' event ports and pipes

Hi,

I experience strange behaviour with libevent on Solaris in combination with pipes.
Start the following program and then kill its child.  The parent goes in an endless loop instead of exiting.
When using socketpair() instead of pipe() everything works as expected.
Setting EVENT_NOEVPORT=y also makes it work.

Im using libevent-1.4.9-stable on Solaris 5.10


   Jörg


/////////////////////////////////////////////////////
#include <event.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>

static void eventCallback( int fd, short swhat, void* ud )
{
  char buf[100];
  size_t readn = read( fd, buf, sizeof(buf)-1 );
  if( readn > 0 )
  {
    buf[readn] = 0;
    printf( "%s\n", buf );
  }
  else
(Continue reading)

W.C.A. Wijngaards | 4 Feb 2009 17:26
Picon
Favicon

Re: Hang with Solaris' event ports and pipes


Richter wrote:
> Hi,
> 
> I experience strange behaviour with libevent on Solaris in combination with pipes.
> Start the following program and then kill its child.  The parent goes in an endless loop instead of exiting.
> 
> Im using libevent-1.4.9-stable on Solaris 5.10

AFAIK there are bugfixes for solaris 5.10 with regards to pipes. Patch
your solaris system.

I found out a flush() worked as a workaround in one case.

Best regards,
   Wouter.
Mark Seger | 9 Feb 2009 20:26
Picon
Favicon

Failed regression tests

I've seen a few of these over the years via google but didn't really see 
anything that described the fix.
I'm running on RHEL5.3 and downloaded libevent-1.4.9-stable.  I did:
./configure
make
make install
make verify

all the tests passed, and all the regressions failed.  Is there 
something 'special' I need to do when running configure?  I assume it's 
something minor.
-mark
Nick Mathewson | 9 Feb 2009 21:44

Re: Failed regression tests

On Mon, Feb 09, 2009 at 02:26:36PM -0500, Mark Seger wrote:
> I've seen a few of these over the years via google but didn't really see 
> anything that described the fix.
> I'm running on RHEL5.3 and downloaded libevent-1.4.9-stable.  I did:
> ./configure
> make
> make install
> make verify
> 
> all the tests passed, and all the regressions failed.  Is there 
> something 'special' I need to do when running configure?  I assume it's 
> something minor.

Well, _something's_ gone wrong.  Unfortunately, the 1.4.9 regression
tests are a little screwy, in that a single failed test can keep all
the others from passing.  In 2.0, we've rewritten the test engine so
that unit tests that mess with global state run each in their own
subprocess.  Can you try checking out trunk with subversion from the
URL
  https://levent.svn.sourceforge.net/svnroot/levent/trunk/libevent
, and see whether that is more specific about which tests are failing
for you?  This might help track down what the problem is.

hope this helps,
--

-- 
Nick
Mark Seger | 9 Feb 2009 22:06
Picon
Favicon

Re: Failed regression tests


Niels Provos wrote:
> On Mon, Feb 9, 2009 at 11:26 AM, Mark Seger <Mark.Seger <at> hp.com> wrote:
>   
>> all the tests passed, and all the regressions failed.  Is there something
>> 'special' I need to do when running configure?  I assume it's something
>> minor.
>>     
>
> Running ./test/Simple DNS resolve: [Timed out] FAILED
> regress by itself would also give us which specific
> test was failing.
>   
Simple DNS resolve: [Timed out] FAILED
aha!  this smells like a config problem on my end, right?
-mark
> Niels.
>   
Seger, Mark | 9 Feb 2009 23:18
Picon
Favicon

RE: Failed regression tests

I look at the code for the dns regression test and it looks like it's trying to resolve www.monkey.org, but
I'm on a private network and so that address will never resolve.  Is that my issue and should I care?  I
wouldn't think so...
-mark

-----Original Message-----
From: libevent-users-bounces <at> monkey.org [mailto:libevent-users-bounces <at> monkey.org] On Behalf Of
Seger, Mark
Sent: Monday, February 09, 2009 4:07 PM
To: Niels Provos
Cc: libevent-users <at> monkey.org
Subject: Re: [Libevent-users] Failed regression tests

Niels Provos wrote:
> On Mon, Feb 9, 2009 at 11:26 AM, Mark Seger <Mark.Seger <at> hp.com> wrote:
>   
>> all the tests passed, and all the regressions failed.  Is there something
>> 'special' I need to do when running configure?  I assume it's something
>> minor.
>>     
>
> Running ./test/Simple DNS resolve: [Timed out] FAILED
> regress by itself would also give us which specific
> test was failing.
>   
Simple DNS resolve: [Timed out] FAILED
aha!  this smells like a config problem on my end, right?
-mark

> Niels.
(Continue reading)

wolfgang | 12 Feb 2009 15:25
Picon

"evbuffer_read" or "bufferevent_read" ?

Hi,

I dived into libevent a couple of days ago.

To learn how to use libevent, I've been surfing sorce codes of simple
servers in
google codes using libevent and found two similar functions to read data from a
file descriptor:

"evbuffer_read" and "bufferevent_read".

The former is to read data from a file descriptor and store it in a
buffer(evbuffer).
The latter is to read data from a bufferevent and store it in a buffer(void *).

>From my perspective, they are all same.
I mean they use a different way but they actually accomplish the same
goal which is
to get data from a file descriptor.
( Although the latter doesn't read data directly from a file
descriptor, bufferevent's
internal buffer is automatically filled with data from a file descriptor.)

Now, my question is in what kinda situation should I use the former or
the latter function ?

Thanks in advance.

-wolfgang
(Continue reading)

Tero Marttila | 12 Feb 2009 20:50
Picon

Re: "evbuffer_read" or "bufferevent_read" ?

wolfgang wrote:
> Hi,
> 
> I dived into libevent a couple of days ago.
> 
> To learn how to use libevent, I've been surfing sorce codes of simple
> servers in
> google codes using libevent and found two similar functions to read data from a
> file descriptor:
> 
> "evbuffer_read" and "bufferevent_read".
> 
> The former is to read data from a file descriptor and store it in a
> buffer(evbuffer).
> The latter is to read data from a bufferevent and store it in a buffer(void *).
> 
>>From my perspective, they are all same.
> I mean they use a different way but they actually accomplish the same
> goal which is
> to get data from a file descriptor.
> ( Although the latter doesn't read data directly from a file
> descriptor, bufferevent's
> internal buffer is automatically filled with data from a file descriptor.)

bufferevent uses evbuffer_read to read the data from its file descriptor into
buffervent's internal input evbuffer:

static void
bufferevent_readcb(evutil_socket_t fd, short event, void *arg)
{
(Continue reading)

Peter Muller | 15 Feb 2009 19:57

Multithreaded envhttpd Server

Hi,


I'm curious about writing an C10K webserver (with additional functionality). I have used libmicrohttpd [1] which uses one thread per client /or/ internal select, but not both. I'm not deep into the sources of libmicrohttpd but it seams as threads are created and dropped as long as they are needed and not preserved for further use (at least the amount of threads variies havely over time). And at about 1500 simultanious connections the server slows noticeable down (without increased cpu load).

Now I'm thinking about changing to libevent. I saw you already have an http server implementation which is like exactly what I need. But as Steven Grimm tells [2] it's pain in the ass to get libevent running with multiple worker threads (which is one of the main requirements because the software is supposed to run on a multi-cpu which multi-core each server).

Would you suggest me using libevent + evnhttpd or something else?


Looking forward to hearing from you
Peter


[1] http://www.gnu.org/software/libmicrohttpd/
[2] http://monkeymail.org/archives/libevent-users/2007-January/000450.html

_______________________________________________
Libevent-users mailing list
Libevent-users <at> monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users
Aleksandar Lazic | 15 Feb 2009 20:41
Picon
Favicon

Re: Multithreaded envhttpd Server

Hi,

On Son 15.02.2009 19:57, Peter Muller wrote:
>Hi,
>
>
>I'm curious about writing an C10K webserver (with additional
>functionality).  I have used libmicrohttpd [1] which uses one thread
>per client /or/ internal select, but not both.

[snipp]

>Would you suggest me using libevent + evnhttpd or something else?

Have you take a look into

nginx http://nginx.net/

Maybe you want to read this blog and get some more questions ;-)

http://www.zenebo.com/word/asynchronous-programming/lighttz-a-simple-and-fast-web-server/

Which features do you need or plan to use?

BR

Aleks

Gmane