Skip to content
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

Cannot read more than 13.6 kilobytes #11

Open
vladislav-sevostyanov opened this issue Oct 28, 2019 · 2 comments
Open

Cannot read more than 13.6 kilobytes #11

vladislav-sevostyanov opened this issue Oct 28, 2019 · 2 comments

Comments

@vladislav-sevostyanov
Copy link

vladislav-sevostyanov commented Oct 28, 2019

If I get the key value using the native 'get' method, I get the full value.
If I use 'redisRStream', then the output is limited to ~ 13.6 kilobytes.

const redis = require('redis');
const client = redis.createClient();
const fs = require('fs');

client.get('mykey', (err, string) => {
  fs.writeFileSync('./file3.txt', string);
});
// file3.txt size ~ 22.2 KiB (it is full size of the value)
const redis = require('redis');
const client = redis.createClient();
const redisRStream = require('redis-rstream');
const fs = require('fs');

const file = fs.createWriteStream('./file2.txt');

redisRStream(client, 'mykey').pipe(file);
// file2.txt size ~ 13.4 KiB

Thus, the value is limited to approximately 13.6 kilobytes if I get it from the redisRStream.

@vladislav-sevostyanov
Copy link
Author

This is because reading does not account for highWaterMark
https://nodejs.org/api/stream.html#stream_readable_readablehighwatermark

@vladislav-sevostyanov
Copy link
Author

vladislav-sevostyanov commented Oct 28, 2019

#13

@vladislav-sevostyanov vladislav-sevostyanov changed the title Cannot read more than 13.4 kilobytes Cannot read more than 13.6 kilobytes Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant