-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Pathological performance of file_handle_cache read buffer when synchronising queues #69
Comments
...such as when we are reading backwards through a file. References #69.
Seems rather sad.
This is the approach I've gone for, primarily because it should be able to stop other pathological behaviour.
This might be a nice option to get syncing going still faster, but it's also fiddly and only solves this exact problem. I'll settle for having it no worse than it was in 3.4.4. |
Just for clarity, this bug:
You can see in the I/O stats on the master that if (say) 250 messages are read from disk per second, we also read 250MB/s even if the messages are much smaller than that. |
Here is what I did to test the correction:
With the
With the
I logged the size of the read buffer in |
Note that you don't need the The 4MB sizes probably refer to other files (queue index files?) Not sure whether the flicking between 10468 and 20936 is worth fixing, what do you think? |
Oh, also you can set a very low |
One correction to my previous comment:
Those should read:
You're right, the file handle differs for those reads.
After a test:
In the first case, we read 20 kB to only use 10 kB, then we read 10 kB, then we double and so on. We don't do this in the second case (we always read 10 kB). When comparing the number of reads to the throughput, we see the 33% decrease of throughput in the second case, corresponding to not wasting 10 kB. However, I can't explain why it is slower... |
While here, fix two typos. References #69.
Here are new, more meaningful numbers comparing The protocol is:
Results with
Results with 8faf4ee:
|
...such as when we are reading backwards through a file. References #69.
While here, fix two typos. References #69.
Take into account the size of the current read if appropriate, add an extra byte when shrinking so next time we know how we did, and fix comments all round. References #69.
Updates queue_master_location/1 parameter spec from pid() to #amqqueue{}
…ffset-epoch-atom Make init_reader and init_data_reader use a consistent return value
Noticed while working on #65.
The queue eager-sync process ends up reading messages from the queue in the opposite order to that in which they were published. If the messages are being read from the message store this causes very poor performance since 3.5.0.
If we have 10kB messages then we read 1MB from near the end of the file, then seek back 10kB, decide that's outside the buffer, read another 1MB, seek back 10kB, and so on. On my machine we sync ~250 msg/s like that. Oops!
Ways we could fix this, in ascending order of cleverness:
The text was updated successfully, but these errors were encountered: