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

SecPKCS12Import bottleneck for acceptance from a listening socket #11

Closed
na-gupta opened this issue Jan 18, 2017 · 2 comments
Closed

SecPKCS12Import bottleneck for acceptance from a listening socket #11

na-gupta opened this issue Jan 18, 2017 · 2 comments

Comments

@na-gupta
Copy link

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.

I will submit a pull request with my changes.

@na-gupta
Copy link
Author

screen shot 2017-01-18 at 2 52 24 pm

na-gupta pushed a commit to na-gupta/BlueSSLService that referenced this issue Jan 18, 2017
na-gupta pushed a commit to na-gupta/BlueSSLService that referenced this issue Jan 18, 2017
billabt added a commit that referenced this issue Jan 19, 2017
#11 Reuse PKCS12 certs to avoid SecPKCS12Import performance hit
@billabt
Copy link
Collaborator

billabt commented Jan 19, 2017

Fixed in 0.12.18.

@billabt billabt closed this as completed 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

No branches or pull requests

2 participants