-
Notifications
You must be signed in to change notification settings - Fork 184
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
bring down memory usage when run as individual services #6819
Comments
This are the current binary sizes for single service binaries: It totals to 1540MB of memory for the binaries alone. If starting these 36 services from the single binary with all oCIS services, this totals to 3312MB. In the case of running every service twice for HA reasons, this boils down to 3080MB vs. 6624MB memory alone for the binaries. |
@rhafer I did not find hint that the binary is virtual memory only:
Though it looks like not the complete binary is in the RSS When I only start the thumbnails service it looks slighly different:
|
@wkloucek Actually there is, I think. The
Yes the whole file is mmaped again (
BTW, do you have output for the single service thumbnails binary? I think the more interesting bit however is the memory usage that kubernetes reports about the pods. In the all-in-one vs. the per-service binary case. (I am not sure if that directly reflects the RSS numbers.) |
When building the thumbnails service on my own, it looks different than the one that I got from CI (even I built it inside the owncloudci/golang container)
When looking at Kubernetes, we can clearly see that Kubernetes is displaying a number that reflects the actual used memory (not the virtual one). This issue seems like noise around nothing.
|
Is your feature request related to a problem? Please describe.
When starting every service on it's own, like eg. in Kubernetes with the oCIS Helm Chart, RAM usage matters in scale.
If you start a Go program, it always needs at least as much memory as the size of the binary. For oCIS the binary size is currenlty 92MB. Therefore if you start a oCIS service, it will at least allocate 92MB. In comparision if compile the thumbnails service standalone, it's binary is only 35MB. Thus it needs 67MB less memory when run.
So the first step is to build and release a separate OCI image for all services: #6818
The next problem is that all REVA runtime based services import everything from REVA (https://github.com/cs3org/reva/blob/b38215dd8772079332e7e6ef6d91bf1d422bfed9/cmd/revad/runtime/loader.go#L21-L57). Therefore all REVA runtime based services produce a binary of 56MB. This applies to the code-wise big storage-users service as well as to the little users service. An exception of code that does come from REVA, but does not use the REVA runtime and therefore produces a smaller binary is the ocdav servcei, which has 35MB.
So the second step would be to stop using the REVA runtime and instead gomicro-fy the REVA services, as we already did with the ocdav service.
cc @d7oc
The text was updated successfully, but these errors were encountered: