-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Auto-scaling Ring Buffer - also downscaling automatical? #50
Comments
That is odd, it has nothing to do with the ring-buffer size but its number based on your desc, Could you tell it more detailedly about the |
Besides, which version of gnet are you using? |
Hi panjf2000, first of all: Thank you for your response. I use version v1.0.0-rc.4. I close the connections and gnet also sees that since it triggers I benchmark my service by docker container. So I have the service running on the host with gnet and then spawn several containers that connect to the service on the host. Every connection is registered via |
Could you use pprof tool to find out which part that occupies the most of memory? In that way, we will have an overall view about the memory usage of your gnet server. |
It seems that ring-buffers weren't GCed after connections were closed but I can't tell why that was happening because ring-buffers would be put back to |
Or could you add some logs to see if the releasing code have been executed? |
Then I have no idea why those ring-buffers from closed connections weren't GCed, that makes no sense, I would have to take some time to investigate it. |
Hi @panjf2000, I run the test for longer time and it looks like it's working. Here's what I did:
Looks like sometimes the Golang GC takes longer. Please excuse the unnecessary confusion and unnecessary work. |
Don't be sorry for that, feel free to open an issue when you encounter any problem when using Also glad to hear that GC works, but still I have a doubt that Golang GC takes that long time(30 minutes) to collect garbages cuz GC is triggered by a fixed and short time(2 minutes) if the last GC finishes over 2 minutes ago, so it is still odd. But on the other hand, it also could be a GC mutator assist which might cause a long time pause to GC, maybe that is it. Anyway, I will keep an eye on the GC in |
Have just discovered Gnet myself and am starting some work with websockets. Is the work you've done publicly available (eg github) or is closed source? Would definitely like to see what you've done (saves me from re-inventing the wheel). Thanks Ken |
Hi @kpfaulkner, sorry, it's closed source. But the gnet examples may help you: https://github.com/gnet-io/gnet-examples Regards, Patrick |
First of all: many thanks for this library!
What is your question about gnet?
I have a question about the ring buffer: Does the ring buffer also downscaling automatically? I didn't find anything in the code, but maybe I'm blind.
I have 40k open websocket sessions, if I now reduce them to 20k, the memory consumption of the ring buffer remains on the same level, even after 30 min.
Thank you in advance for your answer.
The text was updated successfully, but these errors were encountered: