-
Notifications
You must be signed in to change notification settings - Fork 62
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
Improve blob store efficiency #2011
Improve blob store efficiency #2011
Conversation
...b-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
Outdated
Show resolved
Hide resolved
...lob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/DefaultPayloadCodec.java
Outdated
Show resolved
Hide resolved
why is v4 introducing errors? |
Errors are either 400 without cause (null) or the error i posted in the channel. Higher loads might also create issues |
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correcly, all this allows, given a specific context, to choose whether we want to save blobs from raw arrays or inputstreams.
It happens to benefit to performance for the swift use case, great, but it's just an accident.
What if we don't have raw array for important use cases in the future ?
If move is slow, can't we ensure the payload is always passed with the BlobId so that we have opportunities to compute it at the best time possible in the server ?
@@ -31,6 +32,14 @@ public Payload write(InputStream is) { | |||
return Payloads.newInputStreamPayload(is); | |||
} | |||
|
|||
@Override | |||
public Payload write(byte[] bytes) { | |||
if (bytes.length == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this weird case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in that case writing the byte array fails.
But if I do handle it as an InputStream it works.
test this please
|
Can be considered 🍏 |
12a6884
to
97d266c
Compare
Very true.
Well, we will not benefit from the performance improvement for that feature. (mailbox export I am thinking to you) I don't understand why we have to pay the huge price of move when we do not need it.
I don't understand this.
If the payload is not yet known, (ie not yet fully read InputStream) then so do the blobId. Not sure we do want to consume the stream locally to compute the blobId before passing it to swift.... Yet I believe I did prove here that move do have a huge impact. |
test this please |
Status: We could merge V1 & V3 as it has a positive impact, no? And let the v4 part for later... |
97d266c
to
5544345
Compare
} | ||
|
||
public static class InputStreamToSave implements ValueToSave { | ||
private final FixedLengthInputStream inputStream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed soon, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to remove this?
5544345
to
2b08491
Compare
test this please |
test this please |
1 similar comment
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you validate the performance enhencements?
The gatling runs are quite outdated...
I'd like to, but benchs are broken |
test this please |
test this please |
test this please |
c6993dd
to
30dc0b9
Compare
test this please |
test this please |
088123b
to
fc5dd8a
Compare
fc5dd8a
to
2548451
Compare
Here is a list of improvements proposed:
Here is the master run we should refer to:
Here is [v1]
Here is [v2]
Here is [v3] (not present in the changeset)
Here is [v4]
Conclusion:
Note that this higher throughput triggers some unwanted Cassandra/reactor concerns....
[v3] Position content-length has a neglictible impact...
[v2] Read before writes have a slightly negative impact. Thus it was not included in this changeset.