How to change streaming chunk size

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

How to change streaming chunk size

Postby smessica » Thu Sep 11, 2014 3:32 am

Hi,

We have an http streaming request ( CefRequest::Create() ) happening on the IO thread. The data is being accepted via OnDownloadData getting called.
However, the chunk size we get is 4096 bytes max. This seems to be the root cause of a performance issue we have as compared to IE.
In our IE implementation, we request larger chunks and inside the OnDataAvailable callback, we can further read from the stream ( and exiting the callback when all data available is exhausted ).

We see that the streaming is much slower in CEF in comparison to the IE implementation.

So:
1. Is there a way to set a larger chunk to be delivered on each OnDownloadData?
2. Is there a way to pull more data from within the OnDownloadData?
3. Would making those streams on a parallel threads should result in better performance, or would those just be re-directed to the same IO thread?

Thank you,
Shay.
smessica
Techie
 
Posts: 13
Joined: Tue Jul 02, 2013 3:09 pm

Re: How to change streaming chunk size

Postby magreenblatt » Thu Sep 11, 2014 11:22 am

smessica wrote:We have an http streaming request ( CefRequest::Create() ) happening on the IO thread.

What CEF version and OS? I presume you're using CefURLRequest from the browser process.

smessica wrote:However, the chunk size we get is 4096 bytes max. This seems to be the root cause of a performance issue we have as compared to IE.

4KB is a pretty standard buffer size choice. Where is the data coming from (local server, remote server, scheme handler, etc)? Is there a performance issue versus IE if you load the content in the browser directly instead of using CefURLRequest?

smessica wrote:1. Is there a way to set a larger chunk to be delivered on each OnDownloadData?
2. Is there a way to pull more data from within the OnDownloadData?

No.

smessica wrote:3. Would making those streams on a parallel threads should result in better performance, or would those just be re-directed to the same IO thread?

All network reads/writes occur asynchronously on the IO thread.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to change streaming chunk size

Postby smessica » Sun Sep 14, 2014 3:39 am

Hi Marshal,

We are using 1750 over Win7 64bit ( browser process is 32bit ).
Yes, we use CefURLRequest.

This is mostly shown when connected to a server on a remote site.
The request is SOAP, so I cannot tell how the browser itself behaving.
We will try to do a simple download from the browser and update.

Any idea how to boost the streaming performance to be in par with IE?

Thank you,
Shay.
smessica
Techie
 
Posts: 13
Joined: Tue Jul 02, 2013 3:09 pm

Re: How to change streaming chunk size

Postby smessica » Sun Sep 14, 2014 4:20 am

Also, do you think that making the processing on a non-IO thread would boost things up?
I mean, currently, we get the OnDownloadData on the IO thread, where we copy the data/make IPC to the client app.
If we would get the OnDownloadData called on non IO thread, the IO thread might be able to pull more data.
Should it be setup this way? What is the suggested configuration for managing very big SOAP based data download/upload?
smessica
Techie
 
Posts: 13
Joined: Tue Jul 02, 2013 3:09 pm

Re: How to change streaming chunk size

Postby magreenblatt » Sun Sep 14, 2014 9:56 am

Where are you consuming the SOAP data? In a separate non-CEF process?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to change streaming chunk size

Postby smessica » Mon Sep 15, 2014 3:04 am

Yes. The data is consumed on the client application. So, there is an IPC call from the browser's IO_THREAD inside the callback ( each in 4k size max).
Aggregating the data seems to lower the performance. I also think that most likely, storing the data and signaling another thread to make the IPC would not boost as well.

What is your proposed setup for this?
smessica
Techie
 
Posts: 13
Joined: Tue Jul 02, 2013 3:09 pm

Re: How to change streaming chunk size

Postby magreenblatt » Mon Sep 15, 2014 11:51 am

smessica wrote:Yes. The data is consumed on the client application. So, there is an IPC call from the browser's IO_THREAD inside the callback

Where is this IPC call going?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to change streaming chunk size

Postby smessica » Wed Sep 17, 2014 4:25 am

OK, now that we moved this IPC call to another thread, things start to run much faster.
I guess this is the main difference with the IE implementation. They do the IO on another thread and provide the callback on a different thread, which allows us to keep pulling data and send it in larger chunks.

I think we are set for now. Thanks for your support.
smessica
Techie
 
Posts: 13
Joined: Tue Jul 02, 2013 3:09 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 90 guests