You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/02/10 18:20:08 UTC
[GitHub] [couchdb] rnewson opened a new pull request #3366: Couch server sharding
rnewson opened a new pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366
## Overview
Break up the monolithic couch_server to avoid a bottleneck.
## Testing recommendations
Heavy usage.
## Related Issues or Pull Requests
N/A
## Checklist
- [X] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
- [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777104434
tests pass locally. getting random 1 or 2 failures each time on our CI change. I would like to disable them if they aren't going to run reliably.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574052515
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
+ name(BaseName, N);
+
+name(BaseName, #server{} = Srv) ->
+ name(BaseName, Srv#server.n);
Review comment:
I thought about it but there are a fair few paths where we're not inside the couch_server gen process, but I'll look to see if we can do it tidily.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] davisp commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
davisp commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778355795
@wohali What do you mean which is which? Those message queues are the registered names. Thus, `couch_server_1` literally translates to a process registered under that name that can be inspected via `process_info/1` and friends.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-776921180
couch_server as a single gen_server has a finite throughput that, in busy clusters, is easily breached, causing a sizeable backlog in the message queue, ultimately leading to failure and errors.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] chewbranca commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
chewbranca commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574059642
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
Review comment:
@nickva I'm having trouble finding a reference, but I've been under the impression that `timer:tc` is not to be trusted on anonymous functions in the shell and should be tested on a compiled module.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777080949
How will this affect the output of the `message_queues` key in `_system` stats?
I'm not super familiar [This line](https://github.com/apache/couchdb/blob/main/src/chttpd/src/chttpd_node.erl#L215) calls `registered()` and I don't know how that works for multiple `gen_servers` that all appear to have the same name.
I suspect it'd be useful to be able to generate a (new?) stat that showed message queues by `couch_server` shard, identifying by db/shard serviced by that `gen_server`. But I might be assuming something here that isn't real... :upside_down_face:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r573977801
##########
File path: src/couch/src/couch_server.erl
##########
@@ -343,7 +348,7 @@ all_databases() ->
{ok, lists:usort(DbList)}.
all_databases(Fun, Acc0) ->
- {ok, #server{root_dir=Root}} = gen_server:call(couch_server, get_server),
+ {ok, #server{root_dir=Root}} = gen_server:call(couch_server_1, get_server),
Review comment:
(because root_dir is the same in all of them)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson edited a comment on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson edited a comment on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777104434
tests pass locally. getting random 1 or 2 failures each time on our CI chain. I would like to disable them if they aren't going to run reliably.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574052117
##########
File path: src/couch/src/couch_server.erl
##########
@@ -301,22 +306,22 @@ terminate(Reason, Srv) ->
if Db == undefined -> ok; true ->
couch_util:shutdown_sync(couch_db:get_pid(Db))
end
- end, nil, couch_dbs),
+ end, nil, couch_dbs(Srv)),
ok.
handle_config_change("couchdb", "database_dir", _, _, _) ->
exit(whereis(couch_server), config_change),
remove_handler;
-handle_config_change("couchdb", "update_lru_on_read", "true", _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,true})};
-handle_config_change("couchdb", "update_lru_on_read", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,false})};
-handle_config_change("couchdb", "max_dbs_open", Max, _, _) when is_list(Max) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,list_to_integer(Max)})};
-handle_config_change("couchdb", "max_dbs_open", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,?MAX_DBS_OPEN})};
-handle_config_change("couchdb_engines", _, _, _, _) ->
- {ok, gen_server:call(couch_server, reload_engines)};
+handle_config_change("couchdb", "update_lru_on_read", "true", _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,true})};
+handle_config_change("couchdb", "update_lru_on_read", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,false})};
+handle_config_change("couchdb", "max_dbs_open", Max, _, N) when is_list(Max) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,list_to_integer(Max)})};
+handle_config_change("couchdb", "max_dbs_open", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,?MAX_DBS_OPEN})};
+handle_config_change("couchdb_engines", _, _, _, N) ->
+ {ok, gen_server:call(couch_server(N), reload_engines)};
Review comment:
Each of the couch_servers get the callback and do this once each.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778189676
took me way to long to see my mistake. I called couch_server:couch_server(DbName) in couch_lru.erl instead of couch_server:couch_dbs(DbName). So the _new_ mystery is why these tests pass locally...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali edited a comment on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali edited a comment on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777080949
How will this affect the output of the `message_queues` key in `_system` stats?
[This line](https://github.com/apache/couchdb/blob/main/src/chttpd/src/chttpd_node.erl#L215) calls `registered()` and I don't know how that works for multiple `gen_servers` that all appear to have the same name.
I suspect it'd be useful to be able to generate a (new?) stat that showed message queues by `couch_server` shard, identifying by db/shard serviced by that `gen_server`. But I might be assuming something here that isn't real... :upside_down_face:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778222394
I've added the division at https://github.com/apache/couchdb/pull/3366/files#diff-2a7cfe9afa75338cd45f2ab010896e7cf24ea59b4355404f5412000cd9c7d934R296.
The idea is that instead of 1 gen_server/ets tables handling all $max_dbs_open items, we have N gen_server/ets tables handling $max_dbs_open/N items.
This is the least surprising behaviour. The alternative would be a silent multiplying of max_dbs_open by the number of schedulers, a number that is usually not consciously chosen and varies by host.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] chewbranca commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
chewbranca commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574037575
##########
File path: src/couch/src/couch_server.erl
##########
@@ -301,22 +306,22 @@ terminate(Reason, Srv) ->
if Db == undefined -> ok; true ->
couch_util:shutdown_sync(couch_db:get_pid(Db))
end
- end, nil, couch_dbs),
+ end, nil, couch_dbs(Srv)),
ok.
handle_config_change("couchdb", "database_dir", _, _, _) ->
exit(whereis(couch_server), config_change),
remove_handler;
-handle_config_change("couchdb", "update_lru_on_read", "true", _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,true})};
-handle_config_change("couchdb", "update_lru_on_read", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,false})};
-handle_config_change("couchdb", "max_dbs_open", Max, _, _) when is_list(Max) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,list_to_integer(Max)})};
-handle_config_change("couchdb", "max_dbs_open", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,?MAX_DBS_OPEN})};
-handle_config_change("couchdb_engines", _, _, _, _) ->
- {ok, gen_server:call(couch_server, reload_engines)};
+handle_config_change("couchdb", "update_lru_on_read", "true", _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,true})};
+handle_config_change("couchdb", "update_lru_on_read", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,false})};
+handle_config_change("couchdb", "max_dbs_open", Max, _, N) when is_list(Max) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,list_to_integer(Max)})};
+handle_config_change("couchdb", "max_dbs_open", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,?MAX_DBS_OPEN})};
+handle_config_change("couchdb_engines", _, _, _, N) ->
+ {ok, gen_server:call(couch_server(N), reload_engines)};
Review comment:
Hmmm... do we want to trigger the config change callbacks `N` times now? The current approach keeps the code simpler, and I'm being a bit pedantic here, but it might be worth making a dedicated config listener pid that loops over the couch_server pids to trigger updates.
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
+ name(BaseName, N);
+
+name(BaseName, #server{} = Srv) ->
+ name(BaseName, Srv#server.n);
Review comment:
If we're caching N, should we also just cache the relevant atoms so we're not doing `list_to_atom` on concatenated strings every time? Probably won't have a major impact given this approach will have parallelize couch_server pids, but it's certainly more work to do for them to do.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva edited a comment on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
nickva edited a comment on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777737131
I noticed one of the failed tests in `
continuous-integration/jenkins/pr-merge` a `couch_server` failure in it. I ran the test suite locally and it passed so could be just a flaky test and the new code just highlights the flakiness, but since couch_server showed up it was a bit suspicious so thought I'd mention it here:
```
[2021-02-11T18:42:04.494Z] Multiple database create/delete tests
[2021-02-11T18:42:04.853Z] couch_db_tests:111: should_create_multiple_dbs...[0.090 s] ok
[2021-02-11T18:42:04.853Z] couch_db_tests:122: should_delete_multiple_dbs...*failed*
[2021-02-11T18:42:04.853Z] in function gen_server:call/3 (gen_server.erl, line 223)
[2021-02-11T18:42:04.853Z] in call from couch_server:create_int/2 (src/couch_server.erl, line 143)
[2021-02-11T18:42:04.853Z] in call from couch_server:create/2 (src/couch_server.erl, line 135)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:create_db/2 (test/eunit/couch_db_tests.erl, line 193)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-fun-1-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-lc$^0/1-0-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-fun-8-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
[2021-02-11T18:42:04.853Z] **exit:{{badarg,[{ets,update_element,
[2021-02-11T18:42:04.853Z] [couch_server_4,
[2021-02-11T18:42:04.853Z] <<"eunit-test-db-cd448fbae5748e8885319d3a0d"...>>,
[2021-02-11T18:42:04.853Z] {5,locked}],
[2021-02-11T18:42:04.853Z] []},
[2021-02-11T18:42:04.853Z] {couch_lru,close_int,2,[{file,"src/couch_lru.erl"},{line,49}]},
[2021-02-11T18:42:04.853Z] {couch_server,maybe_close_lru_db,1,
[2021-02-11T18:42:04.853Z] [{file,"src/couch_server.erl"},{line,405}]},
[2021-02-11T18:42:04.853Z] {couch_server,handle_call,3,
[2021-02-11T18:42:04.853Z] [{file,"src/couch_server.erl"},{line,575}]},
[2021-02-11T18:42:04.853Z] {gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,661}]},
[2021-02-11T18:42:04.853Z] {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,690}]},
[2021-02-11T18:42:04.853Z] {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]},
[2021-02-11T18:42:04.853Z] {gen_server,call,
[2021-02-11T18:42:04.853Z] [couch_server_4,
[2021-02-11T18:42:04.853Z] {create,<<"eunit-test-db-9849e822ba346e3d33d5f388c3"...>>,[]},
[2021-02-11T18:42:04.853Z] infinity]}}
[2021-02-11T18:42:04.853Z] output:<<"">>
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778532407
Never mind. Thanks for the good work on this PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson merged pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson merged pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-776920435
Huh. Can you explain the failure mode in more detail, @rnewson ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] chewbranca commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
chewbranca commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574057312
##########
File path: src/couch/src/couch_server.erl
##########
@@ -301,22 +306,22 @@ terminate(Reason, Srv) ->
if Db == undefined -> ok; true ->
couch_util:shutdown_sync(couch_db:get_pid(Db))
end
- end, nil, couch_dbs),
+ end, nil, couch_dbs(Srv)),
ok.
handle_config_change("couchdb", "database_dir", _, _, _) ->
exit(whereis(couch_server), config_change),
remove_handler;
-handle_config_change("couchdb", "update_lru_on_read", "true", _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,true})};
-handle_config_change("couchdb", "update_lru_on_read", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_update_lru_on_read,false})};
-handle_config_change("couchdb", "max_dbs_open", Max, _, _) when is_list(Max) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,list_to_integer(Max)})};
-handle_config_change("couchdb", "max_dbs_open", _, _, _) ->
- {ok, gen_server:call(couch_server,{set_max_dbs_open,?MAX_DBS_OPEN})};
-handle_config_change("couchdb_engines", _, _, _, _) ->
- {ok, gen_server:call(couch_server, reload_engines)};
+handle_config_change("couchdb", "update_lru_on_read", "true", _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,true})};
+handle_config_change("couchdb", "update_lru_on_read", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_update_lru_on_read,false})};
+handle_config_change("couchdb", "max_dbs_open", Max, _, N) when is_list(Max) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,list_to_integer(Max)})};
+handle_config_change("couchdb", "max_dbs_open", _, _, N) ->
+ {ok, gen_server:call(couch_server(N),{set_max_dbs_open,?MAX_DBS_OPEN})};
+handle_config_change("couchdb_engines", _, _, _, N) ->
+ {ok, gen_server:call(couch_server(N), reload_engines)};
Review comment:
Sure, I just mean it's `N` numbers of config listeners for the same config changes, as each couch_server subscribes to the changes. Like I said, being pedantic here, but we could make a `couch_server_config_listener` that subscribes once and then updates all the `couch_servers` in a loop.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777138822
> tests pass locally. getting random 1 or 2 failures each time on our CI chain. I would like to disable them if they aren't going to run reliably.
If the development team is unable to put in the time to maintain test suites properly, then you have my vote.
I'd bring this up on dev@, but I have, many times over many years, and nothing ever changes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778460208
You can call `couch_server:couch_server(DbName)` from a remsh if you need to know which couch_server_X process a specific database is handled by. I'm not sure how useful that is. Typically at Cloudant we'd kill `couch_server` if it gained such a large message queue that it wasn't going to heal on its own, but I don't recall needing to look inside its state. What's your use case?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-776921761
timeouts, memory blow ups, cats and dogs living together.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] janl edited a comment on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
janl edited a comment on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778236937
> If the development team is unable to put in the time to maintain test suites properly, then you have my vote.
turns out they were real bugs in this PR :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778474473
Hm, ok, I'm still lost. A problem that requires looking into the state of couch_server is going to need remsh access anyway. Can you give me an example?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574075032
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
Review comment:
@chewbranca I think they'd both be hit by the same slowness...
I tried a module mostly out of curiosity:
```erlang
-module(test_hash).
-export([test_crc32/2, test_phash/2]).
test_crc32(N, Val) ->
T0 = erlang:system_time(),
do_crc32(N, Val),
usec_per_cycle(erlang:system_time() - T0, N).
test_phash(N, Val) ->
T0 = erlang:system_time(),
do_phash2(N, Val),
usec_per_cycle(erlang:system_time() - T0, N).
do_crc32(0, _) ->
ok;
do_crc32(N, Val) ->
_ = erlang:crc32(Val) rem 10,
do_crc32(N - 1, Val).
do_phash2(0, _) ->
ok;
do_phash2(N, Val) ->
_ = erlang:phash2(Val, 10),
do_phash2(N - 1, Val).
usec_per_cycle(Native, N) ->
erlang:convert_time_unit(Native, native, microsecond) / N.
```
```
18> test_hash:test_crc32(10000000, DbName).
0.0722587
19> test_hash:test_phash(10000000, DbName).
0.070593
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574053606
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
Review comment:
hm, that looks nice, sure. I don't think checksum vs hash is a strong argument though, they're both means to an end.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
nickva commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-777737131
I notice one of the failed tests in `
continuous-integration/jenkins/pr-merge` a `couch_server` failure in it. I ran the test suite locally and it passed so could be just a flaky test and the new code just highlights the flakiness, but since couch_server showed up it was a bit suspicious so thought I'd mention it here:
```
[2021-02-11T18:42:04.494Z] Multiple database create/delete tests
[2021-02-11T18:42:04.853Z] couch_db_tests:111: should_create_multiple_dbs...[0.090 s] ok
[2021-02-11T18:42:04.853Z] couch_db_tests:122: should_delete_multiple_dbs...*failed*
[2021-02-11T18:42:04.853Z] in function gen_server:call/3 (gen_server.erl, line 223)
[2021-02-11T18:42:04.853Z] in call from couch_server:create_int/2 (src/couch_server.erl, line 143)
[2021-02-11T18:42:04.853Z] in call from couch_server:create/2 (src/couch_server.erl, line 135)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:create_db/2 (test/eunit/couch_db_tests.erl, line 193)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-fun-1-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-lc$^0/1-0-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from couch_db_tests:'-should_delete_multiple_dbs/1-fun-8-'/1 (test/eunit/couch_db_tests.erl, line 123)
[2021-02-11T18:42:04.853Z] in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
[2021-02-11T18:42:04.853Z] **exit:{{badarg,[{ets,update_element,
[2021-02-11T18:42:04.853Z] [couch_server_4,
[2021-02-11T18:42:04.853Z] <<"eunit-test-db-cd448fbae5748e8885319d3a0d"...>>,
[2021-02-11T18:42:04.853Z] {5,locked}],
[2021-02-11T18:42:04.853Z] []},
[2021-02-11T18:42:04.853Z] {couch_lru,close_int,2,[{file,"src/couch_lru.erl"},{line,49}]},
[2021-02-11T18:42:04.853Z] {couch_server,maybe_close_lru_db,1,
[2021-02-11T18:42:04.853Z] [{file,"src/couch_server.erl"},{line,405}]},
[2021-02-11T18:42:04.853Z] {couch_server,handle_call,3,
[2021-02-11T18:42:04.853Z] [{file,"src/couch_server.erl"},{line,575}]},
[2021-02-11T18:42:04.853Z] {gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,661}]},
[2021-02-11T18:42:04.853Z] {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,690}]},
[2021-02-11T18:42:04.853Z] {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]},
[2021-02-11T18:42:04.853Z] {gen_server,call,
[2021-02-11T18:42:04.853Z] [couch_server_4,
[2021-02-11T18:42:04.853Z] {create,<<"eunit-test-db-9849e822ba346e3d33d5f388c3"...>>,[]},
[2021-02-11T18:42:04.853Z] infinity]}}
[2021-02-11T18:42:04.853Z] output:<<"">>
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778207412
@wohali the processes (and ets tables) have different names. I checked _system output and its as expected
```
"mem3_reshard_sup": 0,
"mem3_reshard_job_sup": 0,
"erl_prim_loader": 0,
"couch_server_16": 0,
"mem3_reshard_dbdoc": 0,
"couch_server_15": 0,
"couch_epi_sup": 0,
"couch_server_14": 0,
"mem3_reshard": 0,
"couch_server_13": 0,
"init": 0,
"couch_server_12": 0,
"couch_server_11": 0,
"mem3_nodes": 0,
"couch_server_10": 0,
"couch_server_9": 0,
"couch_server_8": 0,
"couch_server_7": 0,
"couch_server_6": 0,
"code_server": 0,
"couch_server_5": 0,
"couch_server_4": 0,
"application_controller": 0,
"httpc_sup": 0,
...
```
Consumers of this will need to adjust expectations for sure, though the _stats endpoint is fine, each couch_server_X process increments the same named stats as before.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r573967470
##########
File path: src/couch/src/couch_server.erl
##########
@@ -72,12 +73,16 @@ get_uuid() ->
end.
get_stats() ->
- {ok, #server{start_time=Time,dbs_open=Open}} =
- gen_server:call(couch_server, get_server),
+ Fun = fun(N, {TimeAcc, OpenAcc}) ->
+ {ok, #server{start_time=Time,dbs_open=Open}} =
+ gen_server:call(couch_server(N), get_server),
+ {max(Time, TimeAcc), Open + OpenAcc} end,
Review comment:
"Time" here is a formatted datetime string, so 'max' is a bit arbitrary. all the couch_server_X's are started at the same time, not sure we care?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574045853
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
Review comment:
```1 + erlang:phash2(DbName, num_servers())``` might be cleaner here since we are not really computing a checksum but want to do hashing
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778468715
@rnewson Talking people through problem solving remotely, people who are not generally facile with (or are frightened by) remsh.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r573967726
##########
File path: src/couch/src/couch_server.erl
##########
@@ -114,15 +119,13 @@ update_lru(DbName, Options) ->
case config:get_boolean("couchdb", "update_lru_on_read", false) of
true ->
case lists:member(sys_db, Options) of
- false -> gen_server:cast(couch_server, {update_lru, DbName});
+ false -> gen_server:cast(couch_server(DbName), {update_lru, DbName});
true -> ok
end;
false ->
ok
end.
-close_lru() ->
Review comment:
No calls to this from outside the module
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] janl commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
janl commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778236937
> If the development team is unable to put in the time to maintain test suites properly, then you have my vote.
turnout they were real bugs in this PR :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] rnewson commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
rnewson commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778207976
The only remaining question before merging is whether we redefine what `max_dbs_open` to be per scheduler, or whether I should reduce `max_dbs_open` by the num_servers() factor internal to each couch_server. My preference is for the latter but it's an important point to get opinions on.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] nickva commented on a change in pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#discussion_r574053457
##########
File path: src/couch/src/couch_server.erl
##########
@@ -860,19 +865,55 @@ get_engine_path(DbName, Engine) when is_binary(DbName), is_atom(Engine) ->
end.
lock(DbName, Reason) when is_binary(DbName), is_binary(Reason) ->
- case ets:lookup(couch_dbs, DbName) of
+ case ets:lookup(couch_dbs(DbName), DbName) of
[] ->
- true = ets:insert(couch_dbs_locks, {DbName, Reason}),
+ true = ets:insert(couch_dbs_locks(DbName), {DbName, Reason}),
ok;
[#entry{}] ->
{error, already_opened}
end.
unlock(DbName) when is_binary(DbName) ->
- true = ets:delete(couch_dbs_locks, DbName),
+ true = ets:delete(couch_dbs_locks(DbName), DbName),
ok.
+db_updated(Db) ->
+ DbName = couch_db:name(Db),
+ gen_server:call(couch_server(DbName), {db_updated, Db}, infinity).
+
+
+couch_server(Arg) ->
+ name("couch_server", Arg).
+
+
+couch_dbs(Arg) ->
+ name("couch_dbs", Arg).
+
+
+couch_dbs_pid_to_name(Arg) ->
+ name("couch_dbs_pid_to_name", Arg).
+
+
+couch_dbs_locks(Arg) ->
+ name("couch_dbs_locks", Arg).
+
+
+name(BaseName, DbName) when is_binary(DbName) ->
+ N = 1 + (erlang:crc32(DbName) rem num_servers()),
Review comment:
May even be a tiny bit faster...
```
> DbName = crypto:strong_rand_bytes(100).
<<23,241,236,53,92,151,12,217,246,88,65,153,224,214,236,
240,126,243,188,248,53,187,206,165,235,96,24,5,38,...>>
> f(USec), {USec, ok} = timer:tc(fun() -> [erlang:crc32(DbName) rem 10 || I <- lists:seq(1, 1000000)], ok end), USec/1.0e6.
1.499477
> f(USec), {USec, ok} = timer:tc(fun() -> [erlang:phash2(DbName, 10) || I <- lists:seq(1, 1000000)], ok end), USec/1.0e6.
1.331179
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778305951
@rnewson so no way to determine which couch_server is which without a remsh? Boo. How would I go about that anyway?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] wohali commented on pull request #3366: Couch server sharding
Posted by GitBox <gi...@apache.org>.
wohali commented on pull request #3366:
URL: https://github.com/apache/couchdb/pull/3366#issuecomment-778454576
@davisp which shard is `couch_server_14` serving out?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org