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

#11 Reuse PKCS12 certs to avoid SecPKCS12Import performance hit #12

Merged
merged 1 commit into from
Jan 19, 2017

Conversation

na-gupta
Copy link

Description

Testing Kitura with SSLService causes a significant slowdown on osx (but not on linux). On investigating, it appears that SecPKCS12Import() (that runs every time a listening socket accepts a connection and initializes it's delegate) is very expensive. If we cache and reuse the pkcs12 certs in SSLService.Configuration we get a significant performance increase.

Testing this change with wrk shows a performance improvement from about 150 Requests/sec to about 5200 Requests/sec (35x improvement). It still is much slower than without SSL (24k Requests/sec).

On linux, using OpenSSL, the performance is comparable to without SSL. So there are probably other areas of potential improvement.

Motivation and Context

#11

How Has This Been Tested?

Using Kitura test suite

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.

Copy link
Collaborator

@billabt billabt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. However, there's a couple of places where some additional comments would be useful. After I merge this PR (once CI has completed), I'll add the additional documentation. I've been meaning to do this for a little while now but keep forgetting. Thanks for the changes.

@na-gupta
Copy link
Author

Thanks! Most of the changes are just added indentation because of the new condition. You probably already know this, but if not, to ignore whitespace changes, add ?w=1 to the end of the github URL. Makes it a lot easier.

@billabt
Copy link
Collaborator

billabt commented Jan 18, 2017

Thanks for the tip... I knew about it but am forever forgetting what to put in. 🙄 Must be getting old...

@billabt billabt merged commit 9c45d5b into Kitura:master Jan 19, 2017
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