Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1868

Make memcached storage backend operation non-blocking

    XMLWordPrintableJSON

    Details

      Description

      < Context >
      Since `HttpAysncClient` is non-blocking, but it's operation to memcached at `MemcachedHttpCacheStorage` layer still using blocking I/O manner. Even `spymemcached` client which has non-blocking I/O in nature, but `MemcachedHttpCacheStorage` is using `spymemcached` blocking API.

      < Benefit >
      If all the way in flow of `HttpAsyncClient` is non-blocking, then it can truely do high concurrency with just a few threads, otherwise, performance will be largely impact by blocking calls since there's only a few threads for serving http requests.

      < Code Flow for Blocking manner >

      1. `org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage#getEntry` -> `final MemcachedCacheEntry mce = reconstituteEntry(client.get(key));`
      2. net.spy.memcached.MemcachedClient#get(java.lang.String)

      Should use `net.spy.memcached.MemcachedClient#asyncGet(java.lang.String)`, but then whole API calling structure require big changes.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jimhorng Jim Horng
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: