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
Heap is not cleaned automatically after mass SET #133
Comments
The Go runtime hangs on to memory for as long as possible. As I understand, the memory will eventually be released. But when this happens depends on factors like how often the Go memory allocator reuses the memory pages, the ratio of unused/used memory in the Go process, and how much system memory is available. Go is greedy with memory. Ideally Tile38 would have the The new 1.8 Go runtime (which should be available sometime in February) will have sub-millisecond pauses. This will allow for us to have an automated background GC. In the meantime I recommend sending a |
@tidwall maybe we can add some kind of |
@m1ome I think it may better to add a background garbage collection routine. Something that executes every ~5 minutes. I don't want it to run more often than it needs, in case the Go garbage collector takes too long to complete. Just often enough to help keep overall system resources in check. There's currently a routine that does some very basic memory bookkeeping and also watches the https://github.com/tidwall/tile38/blob/master/controller/controller.go#L180 These can be used as a template. The only code that needs to execute is: runtime.GC()
debug.FreeOSMemory() With Go 1.7 and below, this operation might take upwards of 10ms. In 1.8+ it should be less than a millisecond. |
@tidwall maybe we should add some configuration option for it? Response time may be crucial in some cases, and let's say 10ms in some time it's pretty important. |
@m1ome good idea. Perhaps |
@tidwall if you wish i can implement this one :) |
@m1ome Sure, that would be great. 👍 |
@tidwall awesome! I am on it! |
I just merged the change that include the |
So, I have 73K Point objects
poi
I am inserting
people
withing rate ~ 1000 SET msgs/sec (POINT as well, EX is 10 seconds)There is just one HTTP hook
manual
GC command it backs to 100 MBBefore GC:
After GC
Approximate hook calling rate (measured from endpoint) seems to be OK:
The text was updated successfully, but these errors were encountered: