<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body style="background-color: rgb(255, 255, 255); color: rgb(0, 0,
    0);" text="#000000" bgcolor="#FFFFFF">
    Hi Ivan,<br>
    <br>
    Here's my attempt to increase multithreaded scalability of Cache:<br>
    <br>
<a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~plevart/jdk10-dev/8186628_ssl_session_cache_scalability/webrev.01/">http://cr.openjdk.java.net/~plevart/jdk10-dev/8186628_ssl_session_cache_scalability/webrev.01/</a><br>
    <br>
    Haven't tested this yet, but I thought that since you already have
    relevant performance tests, you might want to try this, so I decided
    to release it as is.<br>
    <br>
    Rough sketch of changes:<br>
    - replaced LinkedHashMap with ConcurrentHashMap<br>
    - CacheEntry(s) are additionaly linked into a double-linked list.
    DL-list management is the only synchronization point (similar to
    Cleaner API) and the rule is: 1st new entry is linked into DL-list,
    then it is put into map - published. The same with removing: 1st an
    entry is unlinked from DL-list, then if successfull, removed from
    map and invalidated.<br>
    - changed the way expiry is handled so that the whole list is never
    needed to be scanned.<br>
    <br>
    The code speaks for itself.<br>
    <br>
    Let me know if you find it usefull and/or it solves the scalability
    bottleneck.<br>
    <br>
    Regards, Peter<br>
    <br>
    <div class="moz-cite-prefix">On 11/21/17 14:16, Ivan Gerasimov
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:bb47df71-8757-b8f0-b725-dc20c43426dd@oracle.com"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900;  padding: 0px 15px; margin: 2px 0px;"><![endif]-->Thanks
      Xuelei for the comment!
      <br>
      <br>
      <br>
      On 11/20/17 8:50 PM, Xuelei Fan wrote:
      <br>
      <blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900;  padding: 0px 15px; margin: 2px 0px;"><![endif]-->Hi
        Ivan,
        <br>
        <br>
        I understand the desire of performance improvement.  But I don't
        think avoiding the use of cache is the price we want to pay for.
        Besides, avoiding using of session cache is not something
        improving the performance in general, it is typically something
        impacting the performance,  a lot sometimes.
        <br>
        <br>
        <!--[if !IE]></DIV><![endif]--></blockquote>
      The proposal is not meant to be a general solution.
      <br>
      Clearly, turning the session cache off will increase the average
      time of session creation.
      <br>
      However, if the cache becomes the reason of a bottleneck due to
      high contention, then turning it off helps by just shortening the
      waiting time for each thread.
      <br>
      <br>
      The option is set to true by default, i.e. the cache is used.
      <br>
      Only if the application is used in such a way that high contention
      for the cache is exposed, then the setting the option to false may
      help to improve performance.
      <br>
      <br>
      With kind regards,
      <br>
      Ivan
      <br>
      <br>
      <blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900;  padding: 0px 15px; margin: 2px 0px;"><![endif]-->Xuelei
        <br>
        <br>
        On 11/20/2017 5:36 PM, Ivan Gerasimov wrote:
        <br>
        <blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900;  padding: 0px 15px; margin: 2px 0px;"><![endif]-->Gentle
          ping.
          <br>
          <br>
          If people agree on the approach, I'll go ahead and file a CCC
          request for the new recognized system property.
          <br>
          <br>
          With kind regards,
          <br>
          <br>
          Ivan
          <br>
          <br>
          <br>
          On 11/7/17 6:24 PM, Ivan Gerasimov wrote:
          <br>
          <blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900;  padding: 0px 15px; margin: 2px 0px;"><![endif]-->Hello
            everybody!
            <br>
            <br>
            The class sun.security.ssl.SSLSessionContextImpl maintains
            caches for the sessions reuse.
            <br>
            Access to the cache from threads is serialized.
            <br>
            It was reported that under heavy load the time of waiting
            for the turn to access the synchronized methods outweighs
            the time of creating a new session.
            <br>
            <br>
            It is proposed to introduce a flag that will allow to avoid
            using the cache altogether.
            <br>
            Would you please help review the proposed fix?
            <br>
            <br>
            BUGURL: <a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8186628">https://bugs.openjdk.java.net/browse/JDK-8186628</a>
            <br>
            WEBREV:
            <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~igerasim/8186628/00/webrev/">http://cr.openjdk.java.net/~igerasim/8186628/00/webrev/</a>
            <br>
            <br>
            <!--[if !IE]></DIV><![endif]--></blockquote>
          <br>
          <!--[if !IE]></DIV><![endif]--></blockquote>
        <br>
        <!--[if !IE]></DIV><![endif]--></blockquote>
      <br>
      <!--[if !IE]></DIV><![endif]--></blockquote>
    <br>
  </body>
</html>