Skip to content

Would like to "freeze" providers #15600

Closed

Description

@richsalz

I think most programs will do some startup about loading providers, etc., and then enter a steady-state.

I think it will make sense for an application to tell OpenSSL to "freeze" the configuration: no new providers will be loaded, nor will any be unloaded. At that point, it should be possible to get very close to the 1.1.1 algorithm lookup performance.

I suggest adding one new API now, that does nothing, but can be implemented during the beta releases. Do not allow an application to "unfreeze", just have this:

int OPENSSL_freeze(void);

After calling this, no new configuration files can be loaded. No new providers can be loaded or unloaded. Nothing changes. The program has to exit.

All property queries would become infinitely cacheable, for example. Encode/decode could become built on-the-fly and reused as arrays of function pointers. TLS algorithms would become immutable based on query.

Activity

  1. paulidale commented on Jun 3, 2021

    @paulidale
    Contributor

    Providers that set the no-cache flag confound this. How would they fit into the freeze world?

    Apart from the encode/decode part (which should happen soon), we're already caching the rest. Stop loading/unloading providers and the caches should be returning the results.

  2. added
    triaged: feature
    on Jun 3, 2021
  3. added this to the 3.0.0 beta1 milestone on Jun 3, 2021
  4. mattcaswell commented on Jun 3, 2021

    @mattcaswell
    Member

    I suggest adding one new API now, that does nothing, but can be implemented during the beta releases

    Beta means we're done with adding new features. According to our current policy if we were going to add such a feature it would have to be implemented before we get to beta1. I can't see OTC accepting it but I've added it to the "beta1" milestone so that it gets reviewed.

  5. levitte commented on Jun 3, 2021

    @levitte
    Member

    Hmmm, the idea that you're talking about is about freezing the set of methods to be fetched, not just about loading / unloading providers. That goes against a design criterion that we talked about from the very beginning, and that's the basis for the no_store flag in the fetching internals. It was quite eloquently put at a meeting, something like this "someone pulls the PKCS#11 token", and that we should be able to handle that situation.

  6. richsalz commented on Jun 3, 2021

    @richsalz
    ContributorAuthor

    I remember the "someone pulls the token" comment. But if the hypothetical PKCS11 provider is loaded, then it should handle the token being removed.

    If the project feels that the caching as-is will work, without any other work or hints from applications, so be it. I am skeptical.

  7. paulidale commented on Jun 3, 2021

    @paulidale
    Contributor

    Any tangible suggestions as to how to improve the caching?
    Simply freezing things won't improve matters -- more would have to be done after that.

    I've got a few ideas but I'm not sure they are a good reward/effort trade.
    Premature optimisation is one of the banes of computing.

  8. richsalz commented on Jun 4, 2021

    @richsalz
    ContributorAuthor

    I have no ideas about how to improve the caching. Premature optimisation is a bane, but we already know the performance in 3.0 is worse than the previous release, #15088. I can write more tests for other things.

  9. paulidale commented on Jun 4, 2021

    @paulidale
    Contributor

    Yeah, decoding is very bad currently. It's being worked on: #15604 is the next step.

  10. mattcaswell commented on Jun 4, 2021

    @mattcaswell
    Member

    I fail to see how "freezing" improves performance. I don't see any analysis in #15088 which tells us what is causing slower performance or why freezing will make it better. My guess is decoding is the most significant bottleneck - so I can't see how "freezing" would help improve that. Much better is to analyse the underlying causes, address those and then iterate.

  11. mattcaswell commented on Jun 8, 2021

    @mattcaswell
    Member

    OTC: We will not be implementing this feature.

  12. nicowilliams commented on May 4, 2023

    @nicowilliams

    IMO this should be reconsidered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triaged: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions