Uploaded image for project: 'Hibernate ORM'
  1. HHH-12626

Avoid high CPU contention by not allocating Session UUIDs eagerly

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.1
    • Component/s: hibernate-core
    • Labels:
      None
    • Last commented by a user?:
      true
    • Sprint:

      Description

      When generating high load with a benchmark on a scalable server, the primary bottleneck becomes the UUID assignment to each Session :

      Stack Trace	Count	Duration
      sun.security.provider.NativePRNG$RandomIO.implNextBytes(byte[])	28,035	883,878,174,458
         sun.security.provider.NativePRNG$RandomIO.access$400(NativePRNG$RandomIO, byte[])	28,035	883,878,174,458
            sun.security.provider.NativePRNG.engineNextBytes(byte[])	28,035	883,878,174,458
               java.security.SecureRandom.nextBytes(byte[])	28,035	883,878,174,458
                  java.util.UUID.randomUUID()	28,004	883,497,665,831
                     org.hibernate.id.uuid.StandardRandomStrategy.generateUUID(SharedSessionContractImplementor)	27,989	881,776,995,638
                        org.hibernate.internal.AbstractSharedSessionContract.<init>(SessionFactoryImpl, SessionCreationOptions)	27,989	881,776,995,638
                           org.hibernate.internal.AbstractSessionImpl.<init>(SessionFactoryImpl, SessionCreationOptions)	27,989	881,776,995,638
                              org.hibernate.internal.SessionImpl.<init>(SessionFactoryImpl, SessionCreationOptions)	27,989	881,776,995,638
                                 org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession()	27,989	881,776,995,638
                                    org.hibernate.internal.SessionFactoryImpl.buildEntityManager(SynchronizationType, Map)	23,157	802,857,346,608
      
      

      This UUID generation can be avoided, especially when temporary tables are not necessary.

        Attachments

          Activity

            People

            • Assignee:
              sanne Sanne Grinovero
              Reporter:
              sanne Sanne Grinovero
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: