You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/03/31 21:58:21 UTC
[couchdb] branch fix-couch-server-avoid-lru-copy-3.0.x created (now
fce6c78)
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a change to branch fix-couch-server-avoid-lru-copy-3.0.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
at fce6c78 Do not copy the #server.lru field to async openers
This branch includes the following new commits:
new fce6c78 Do not copy the #server.lru field to async openers
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: Do not copy the #server.lru field to async openers
Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch fix-couch-server-avoid-lru-copy-3.0.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit fce6c782e63b6d772c1dccd50f41df13b828e044
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Mar 31 16:25:38 2020 -0500
Do not copy the #server.lru field to async openers
This copy slowed down the `erlang:spawn_link/3` call considerably.
Measurements in the wild showed the cost of that `spawn_link/3` going
from roughly 8 uS to 800 uS.
---
src/couch/src/couch_server.erl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 909e238..b2f8fde 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -381,10 +381,13 @@ maybe_close_lru_db(#server{lru=Lru}=Server) ->
end.
open_async(Server, From, DbName, Options) ->
+ NoLRUServer = Server#server{
+ lru = redacted
+ },
Parent = self(),
T0 = os:timestamp(),
Opener = spawn_link(fun() ->
- Res = open_async_int(Server, DbName, Options),
+ Res = open_async_int(NoLRUServer, DbName, Options),
IsSuccess = case Res of
{ok, _} -> true;
_ -> false