You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2017/09/18 21:26:01 UTC

[jira] [Commented] (HTTPASYNC-127) Make memcached storage backend operation non-blocking

    [ https://issues.apache.org/jira/browse/HTTPASYNC-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170745#comment-16170745 ] 

Oleg Kalnichevski commented on HTTPASYNC-127:
---------------------------------------------

Hi Jim
The caching APIs in 4.x have been initially built as blocking and are inherently synchronous. HttpAysncClient tries to work around this design limitation but not very elegantly. We cannot change that in the 4.x series but we can in 5.x. I am currently in the process of rethinking and redesigning the caching APIs for the 5.x series. You are very welcome to contribute your ideas preferably by way of raising pull requests with real code changes.

Oleg

> Make memcached storage backend operation non-blocking
> -----------------------------------------------------
>
>                 Key: HTTPASYNC-127
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-127
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Improvement
>            Reporter: Jim Horng
>
> < 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 >
> # `org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage#getEntry` -> `final MemcachedCacheEntry mce = reconstituteEntry(client.get(key));` 
> # 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org