librelist archives

« back to archive

Delay in IOBuf_Read

Delay in IOBuf_Read

From:
Marc Croom
Date:
2010-12-09 @ 13:30
Hi all,

I'm seeing a delay of 2-3 seconds in IOBuf_Read for request payloads greater
than 1024 bytes.

From the log:

DEBUG src/connection.c:444: HTTP MESSAGE
DEBUG src/state.rl:57: --> route_request(HTTP_REQ:105) State_exec:57
DEBUG src/server.c:175: Looking for target host: localhost
DEBUG src/routing.c:200: Found simple suffix: localhost
DEBUG src/routing.c:218: Found simple prefix: /handler
DEBUG src/host.c:127: Found backend at /handler
DEBUG src/state.rl:60: --> http_to_handler(HANDLER:104) State_exec:60
DEBUG src/io.c:254: IOBuf_read: calling the recv for 4096 bytes, buf->len:
4096, buf->cur: 0, buf->avail: 0

********************> DELAY HERE

DEBUG src/io.c:261: Read 2629 bytes of data. buf->cur: 0, buf->avail: 0

... carries on as normal and completes successfully

I'm seeing this on both os x and linux, I've tested with 1.3, 1.4 and the
latest from trunk and they all exhibit the same behaviour. Can anybody point
out what I might be doing wrong, I would greatly appreciate any help with
this.

Cheers,
Marc

Delay in IOBuf_Read

From:
Marc Croom
Date:
2010-12-09 @ 16:47
Ok, I now see this is a problem with the Expect: 100-continue header.
Disabled that in curl and it's working.

Re: [mongrel2] Delay in IOBuf_Read

From:
Zed A. Shaw
Date:
2010-12-09 @ 17:30
On Thu, Dec 09, 2010 at 02:47:56PM -0200, Marc Croom wrote:
> Ok, I now see this is a problem with the Expect: 100-continue header.
> Disabled that in curl and it's working.

That must be a new addition, can you give me more info on what you had
to disable, the version of curl, etc.?  Thanks.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Delay in IOBuf_Read

From:
Marc Croom
Date:
2010-12-09 @ 17:44
I just disabled the sending of the Expect header in curl ( -H "Expect:" )
since it seems to be adding it automatically for request payloads over 1024
bytes. Not sure if m2 is supposed to be handling the Expect: 100-continue
header, if it is, there appears to be a small glitch.

On Thu, Dec 9, 2010 at 3:30 PM, Zed A. Shaw <zedshaw@zedshaw.com> wrote:

> On Thu, Dec 09, 2010 at 02:47:56PM -0200, Marc Croom wrote:
> > Ok, I now see this is a problem with the Expect: 100-continue header.
> > Disabled that in curl and it's working.
>
> That must be a new addition, can you give me more info on what you had
> to disable, the version of curl, etc.?  Thanks.
>
> --
> Zed A. Shaw
> http://zedshaw.com/
>

Re: [mongrel2] Delay in IOBuf_Read

From:
Zed A. Shaw
Date:
2010-12-09 @ 18:23
On Thu, Dec 09, 2010 at 03:44:26PM -0200, Marc Croom wrote:
> I just disabled the sending of the Expect header in curl ( -H "Expect:" )
> since it seems to be adding it automatically for request payloads over 1024
> bytes. Not sure if m2 is supposed to be handling the Expect: 100-continue
> header, if it is, there appears to be a small glitch.

Well, one more thing about HTTP that's annoying. I've got a ticket for
it:

http://mongrel2.org/tktview/92c09e959efc10475603f7b23e03852e6cee6e01

Thanks.

-- 
Zed A. Shaw
http://zedshaw.com/

Delay in IOBuf_Read

From:
Marc Croom
Date:
2010-12-09 @ 13:31
Hi all,

I'm seeing a delay of 2-3 seconds in IOBuf_Read for request payloads greater
than 1024 bytes.

From the log:

DEBUG src/connection.c:444: HTTP MESSAGE
DEBUG src/state.rl:57: --> route_request(HTTP_REQ:105) State_exec:57
DEBUG src/server.c:175: Looking for target host: localhost
DEBUG src/routing.c:200: Found simple suffix: localhost
DEBUG src/routing.c:218: Found simple prefix: /handler
DEBUG src/host.c:127: Found backend at /handler
DEBUG src/state.rl:60: --> http_to_handler(HANDLER:104) State_exec:60
DEBUG src/io.c:254: IOBuf_read: calling the recv for 4096 bytes, buf->len:
4096, buf->cur: 0, buf->avail: 0

********************> DELAY HERE

DEBUG src/io.c:261: Read 2629 bytes of data. buf->cur: 0, buf->avail: 0

... carries on as normal and completes successfully

I'm seeing this on both os x and linux, I've tested with 1.3, 1.4 and the
latest from trunk and they all exhibit the same behaviour. Can anybody point
out what I might be doing wrong, I would greatly appreciate any help with
this.

Cheers,
Marc