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

Multi threading #63

Open
st1971 opened this issue Sep 7, 2022 · 2 comments
Open

Multi threading #63

st1971 opened this issue Sep 7, 2022 · 2 comments

Comments

@st1971
Copy link

st1971 commented Sep 7, 2022

Would it be possible to get a multi-threaded example, we are trying to scale out encryption and decryption operations using threading to try and counter network latency however we keep getting 'operation in progress internal error code 0x000000BB' errors in the client log which translate to a pkcs#11 error code 6 which is operation failed. I am guessing this is going to be down to where and what we need to lock with mutex's but cannot find any reference or examples to help with this.

@rday
Copy link
Member

rday commented Sep 26, 2022

@st1971 I would expect a CKR_OPERATION_ACTIVE error if this were a multi threading issue against a pool of PKCS#11 sessions, but I don't know enough context. This particular error indicates high enough load that the HSM can not process all the requests.

Are you able to share the version of the SDK you are using?
How many concurrent requests are hitting your cluster at the same time?
How many requests of each type are hitting your cluster at the same time? (keygen, enc/dec, sign/verify)
How many HSMs are in your cluster?

You may be able to open a case with AWS Developer Support if you are more comfortable sharing details privately.

@st1971
Copy link
Author

st1971 commented Sep 30, 2022

@rday we are discussing with AWS support at the moment in terms of the errors that we are seeing, which seem to be a cluster capacity issue when performing large numbers of key unwraps (we are using envelope encryption pattern).

what would be useful in this repo is a multi threaded example either with pthreads or OpenMP, the doco with the client does not give any view on this but most of the AWS blogs suggest that 50-100 threads are needed to combat network latency.

We are using SDK v5 btw.

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