[winswitch] High server memory usage for a simple app
Antoine Martin
totaam at xpra.org
Thu Sep 15 15:24:02 BST 2022
On 13/09/2022 15:41, Thanh IT. Nguyen Trung via shifter-users wrote:
> /usr/bin/python2 /bin/xpra --version
> xpra v3.1.2-r25
This version is out of date.
> uname -a
> Linux dev-server 3.10.0-1160.45.1.el7.x86_64 #1 SMP Fri Sep 24
10:17:16 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
>
> Red Hat Enterprise Linux Server 7.9 (Maipo)
>
> I am testing the simple xclock application and find that with each
connection to the server, it uses about 400MB of RAM
Which process owns this 400MB of RAM?
Is it the xpra server or the Xorg process?
Assuming that it is the xpra server process, have a look at:
xpra info | grep memory
And bear in mind that shared memory... is shared.
So multiple xpra servers all sharing the same libraries and executables
will not be using as much memory as you think.
> Here is the CLIENT command:
> xpra start ssh://myuser:mypassword@myserver.com ^
> --encoding=jpeg
"encoding=jpeg" : don't do that.
> --speaker=disabled --microphone=disabled
--env=XPRA_SCROLL_ENCODING=0 --use-display=auto ^
"use-display=auto" is not a valid option with xpra 3.x
> --env=remoteuser=%username% --html=no --dpi=120
--idle-timeout=3600 --exit-with-client=yes ^
> --exit-with-children=yes --start-child=xclock--opengl=no --quality=80
"quality=80" is a terrible idea, don't do that. Set "min-quality"
instead, or just leave it alone.
--lock=yes
>
> What I've tried so far:
> 1. Disabling microphone and audio
This helps.
> 2. Using encoding=jpeg
This does not.
> 3. Edit /etc/xpra/xorg.conf to use a smaller value of VideoRam =
256000 instead of the default value of 768000
This should help.
> 4. In addition, the manual document says: "The xpra server
allocates an over-large framebuffer when using Xvfb; this wastes memory."
> On our server, it seems that Xpra is using Xdummy (another guy
installed this).
This is the default.
> I don't know how to disable Xvfb and not sure if should I disable it
or not.
Assuming that the memory belongs to Xorg, try to switch to Xvfb to see
if it makes much of a difference.
See /etc/xpra/conf.d/55_server_x11.conf
> In conclusion, my question is: How can I reduce the amount of RAM
that server uses for each connection. Because we have a lot of users
need to connect to the server at the same time.
Turn off every xpra subsystem and only enable the ones you actually
need. In particular, turn off:
* video encoders
* csc modules
* mmap
etc
The results can be seen in these tickets:
* for the client:
https://github.com/Xpra-org/xpra/issues/1861#issuecomment-765499403
* for the server:
https://github.com/Xpra-org/xpra/issues/1838
Newer versions do this more effectively too, though you won't be able to
use them on RHEL 7.
If you still cannot find a solution, please create a github issue.
Cheers,
Antoine
>
> Thank you!
More information about the shifter-users
mailing list