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

when redisReaderFeed big buffer, redisReaderGetReply will cause high cpu usage #656

Closed
hongliuliao opened this issue Apr 8, 2019 · 4 comments

Comments

@hongliuliao
Copy link

hongliuliao commented Apr 8, 2019

when redis reader feed 40m buffer, the get reply will cause high cpu usage like as follow:
image
Because in redisReaderGetReply method, after a reply parsed, it will use "sdsrange" to move mem and when the buffer is big, the memmove() will cost many time & cpu!
image

@mnunberg
Copy link
Contributor

mnunberg commented Apr 8, 2019 via email

@hongliuliao hongliuliao changed the title when redisReaderFeed big buffer, redisReaderGetReply will cause a lot of cpu when redisReaderFeed big buffer, redisReaderGetReply will cause high cpu usage Apr 8, 2019
@hongliuliao
Copy link
Author

Thanks for your reply! I think "this setting configurable" may better. I use redisReaderFeed & redisReaderGetReply to read a big aof file and parse, and then i think when the read buffer is bigger, the performance will better.

@michael-grunder
Copy link
Collaborator

It would be a non-trivial change, but we could look into using a ring buffer.

@michael-grunder
Copy link
Collaborator

Closing in favor of #866

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

3 participants