-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LevelDB Threads #236
Comments
|
We actually work on riak, and have gone through the AAE code several times to ensure that it is not due to the design, or the AAE code that could be providing this bottleneck. Which is why I was asking about how those threads work, as that is one of the major changes (I believe) to the leveldb dependancy, between riak's older stable versions (2.0.X) and the (2.2.5) riak releases. I had also read some of your posts on the leveldb wiki in the past whereby changes to leveldb had caused customers using it as there 'storage backend' to experience these net_kernel tick timeouts. We will keep on digging into it, thanks for taking the time to explain all of the above. |
The leveldb code intentionally slows down the rate of user write operations when the volume of compactions gets too high. AAE will slam 1,000 or more keys into the system at once. There is some code to reduce the impact of the intentional write slow downs for AAE, but when leveldb is behind user needs to wait. I suggest you look at disk write activity relative to the time you see net_kernel tick counts ... which by the way, I do not know net_kernel statistic ... at least not by that name. |
Oh, and there is a known bug in the Erlang AAE code where two processes share the same leveldb iterator token. This is a really bad thing. It has lead to segfault crashes. Was not fixed before Basho closed. The eleveldb code has mutexes to help defend against this bad Erlang code. Sitting on one of those mutexes could result in the waits you are seeing. I believe the impact was typically seen during an AAE tree rebuild ... which I think posts status to one of Riak's command line tools. Again, there is heavy disk activity during the tree rebuild. |
Hi @matthewvon,
The latest version of leveldb "2.0.35" see's a move away from the erlang scheduler, and instead using a worker pool of threads that are created in C++ in leveldb. In the code I can see that the use of 71 threads has been decided upon.
From comments in the wiki, and the git logs, I saw that the number was decided to be a prime.
I ask due seeing net_kernel tick timeouts (stalls) in our test environment. We have set riak's sysmon long scheduler, and often see it is long timeouts in the riak_kv_vnode surrounding a gen_call. The only place I have found a gen_call to take place in the riak_kv_vnode is at riak_kv_index_hashtree:insert/3 (call once all the tokens have been used up). This at times can take > 10 seconds to complete.
The text was updated successfully, but these errors were encountered: