Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the fetch queue to have an initial size. #1000

Merged
merged 2 commits into from
May 16, 2019
Merged

Conversation

manthey
Copy link
Contributor

@manthey manthey commented May 3, 2019

This adds the concept of an initial queue size to the fetch queue. Once the initial queue size requests have been satisfied, then the regular queue size is used unless the initial queue size is reapplied.

For tile layers, the queue size and initial queue size can now be specified directly, rather than reaching in to the _queue property and modifying the queue there.

The default queue size remains at 6. This value corresponds to most browsers using a maximum of 6 requests per domain. If a tile source with subdomains is used, this could be increased to 6 * (number of subdomains). There doesn't seem to be any measurable improvement doing so with the default osm tile source, though.

The default is not to use an initial queue size. However, when using tile servers that cache open tile sources and need time to serve the first tile when not in cache, using an initial queue size of 1 can reduce server load, as the tile server will get a single request, serve it, and then get 6 simultaneous requests thereafter.

This adds the concept of an initial queue size to the fetch queue.  Once
the initial queue size requests have been satisfied, then the regular
queue size is used unless the initial queue size is reapplied.

For tile layers, the queue size and initial queue size can now be
specified directly, rather than reaching in to the _queue property and
modifying the queue there.

The default queue size remains at 6.  This value corresponds to most
browsers using a maximum of 6 requests per domain.  If a tile source
with subdomains is used, this could be increased to 6 * (number of
subdomains).  There doesn't seem to be any measurable improvement doing
so with the default osm tile source, though.

The default is not to use an initial queue size.  However, when using
tile servers that cache open tile sources and need time to serve the
first tile when not in cache, using an initial queue size of 1 can
reduce server load, as the tile server will get a single request, serve
it, and then get 6 simultaneous requests thereafter.
@manthey manthey merged commit fb6baf3 into master May 16, 2019
@manthey manthey deleted the queue-initial-size branch May 16, 2019 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants