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

Performance: Increase number of GCD read queues #235

Merged
merged 1 commit into from
Feb 22, 2018
Merged

Performance: Increase number of GCD read queues #235

merged 1 commit into from
Feb 22, 2018

Conversation

djones6
Copy link
Contributor

@djones6 djones6 commented Dec 8, 2017

Description

Increases the number of GCD serial read queues to 4 (on OSX) or 8 (Linux, when compiled with GCD_ASYNCH).

Motivation and Context

This increases Kitura throughput by (ballpark) 5% (OSX) / 30% (Linux). The precise benefit depends on the nature of the workload (whether it is predominantly receive, send or 'think time' limited) and how many physical threads the system has.

Linux sees a universal improvement from increasing the number of queues, and in fact benefits even more from a higher number, but there are diminishing returns which are probably not worth the corresponding increase in memory footprint.

Most workloads improve on a 4-core Macbook with this change. The smaller Mac Mini shows slight regression from the change, but I would expect that 4+ cores is a more likely environment where performance is important. I do not have access to Mac hardware with >4 cores.

Linux (Ubuntu 16.04, Swift 4) - 4 cores, 8 threads

Note that the charts below show experiments with number of both GCD and Epoll queues. Only the GCD (blue) results are relevant for this PR, as I am not proposing a change for Epoll.
image

image

image

image

OSX (Sierra, Swift 4) - Mac Mini 2-core / Macbook Pro 4-core

Note that the colours mean different things to the Linux charts above: the graphs below show results on a 2-core Mac Mini (blue) and 4-core Macbook (orange).
image

image

image

image

Full data (internal link): https://ibm.ent.box.com/file/211761963959

How Has This Been Tested?

As well as the performance tests above, I have run the Kitura-net tests locally on Linux and OSX and they pass.

Checklist:

  • I have submitted a CLA form
  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

@codecov-io
Copy link

codecov-io commented Dec 8, 2017

Codecov Report

Merging #235 into master will decrease coverage by 0.53%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #235      +/-   ##
==========================================
- Coverage   77.72%   77.18%   -0.54%     
==========================================
  Files          47       46       -1     
  Lines        6939     6838     -101     
  Branches      568      561       -7     
==========================================
- Hits         5393     5278     -115     
+ Misses       1432     1427       -5     
- Partials      114      133      +19
Flag Coverage Δ
#CHTTPParser 77.18% <100%> (-0.32%) ⬇️
#KituraNet 77.18% <100%> (-0.54%) ⬇️
Impacted Files Coverage Δ
Sources/KituraNet/IncomingSocketHandler.swift 81.13% <100%> (-3.17%) ⬇️
...ces/KituraNet/Server/ServerLifecycleListener.swift 81.57% <0%> (-7.9%) ⬇️
Sources/KituraNet/HTTP/HTTPServerRequest.swift 72.41% <0%> (-4.32%) ⬇️
Sources/KituraNet/HTTPParser/URLParser.swift 97.33% <0%> (-2.67%) ⬇️
Sources/CHTTPParser/http_parser.c 55.15% <0%> (-2.4%) ⬇️
Sources/KituraNet/IncomingSocketManager.swift 85.5% <0%> (-1.45%) ⬇️
Sources/KituraNet/HTTP/HTTPServer.swift 80.35% <0%> (-1.26%) ⬇️
Sources/KituraNet/HTTPParser/HTTPParser.swift 99.02% <0%> (-0.98%) ⬇️
Sources/KituraNet/FastCGI/FastCGIServer.swift 63.58% <0%> (-0.62%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc6e217...991efde. Read the comment docs.

@djones6 djones6 requested a review from tunniclm December 14, 2017 09:31
@djones6 djones6 merged commit 0837058 into master Feb 22, 2018
@djones6 djones6 deleted the queues branch February 22, 2018 16:29
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.

3 participants