Opened 5 years ago

Last modified 7 months ago

#10748 assigned bug

Bottleneck in the Network Kit

Reported by: waddlesplash Owned by: nobody
Priority: normal Milestone: R1
Component: Kits/Network Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #14602
Has a Patch: no Platform: All


This is hrev47102. When using Web+ (libnetapi) to download a file over LAN (guest-to-host in VirtualBox, to be precise) the transfer runs at 2.5MB/s. When using "wget" with the exact same config, it runs at 5MB/s.

I did not determine if the bottleneck is always 1/2 speed or if it simply caps at 2.5MB/s. I did notice the CPU is pegged for both libnetapi and wget.

Change History (6)

comment:1 Changed 5 years ago by tqh

Perhaps you can look at it with Scheduling Recorder? Here is a short howto

comment:2 Changed 5 years ago by Coldfirex

Any change if you give Haiku more than 1 cpu core? Which nic was it given in vbox?

comment:3 Changed 5 years ago by pulkomandy

The libnetapi currently uses a thread for each request, which copies network buffers from the network card to BMessages. This design is suboptimal, unfortunately I'm not sure it's possible to do anything better for Web+, as WebKit is designed around processing everything in the BApplication thread, so network data must come as BMessages.

comment:4 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:5 Changed 7 months ago by waddlesplash

Blocking: 14602 added

comment:6 Changed 7 months ago by waddlesplash

so network data must come as BMessages.

Some sort of a chunk-based ring buffer would make more sense here, I think, with perhaps only periodic wakeups occuring via BMessages. That should avoid a lot of overhead and thus the high CPU usage.

Note: See TracTickets for help on using tickets.