Xvfb multiple displays for parallel processing?
Asked Answered
T

1

9

Curious about running multiple xvfb displays: I have between 10-50 instances of a script running in parallel that connect to an xvfb display. Is is advantageous to run the same number of xvfb displays and connect 1 to 1? Or can multiple processes share the same display? RAM is not an issue, neither is processing power.

Trothplight answered 11/6, 2012 at 20:42 Comment(0)
L
13

One Xvfb server should be able to handle lots of connections quite well. One thing you want to make sure you do is run the server with the -noreset option. Without it, it has a memory leak every time a client disconnects.

The only time multiple Xvfb servers is helpful is if you have more than one processor available in the machine (e.g. 8 cores) and your script is graphics-heavy. To see if this is the case, connect many instances of your script and check top to see what the CPU usage of Xvfb is. If it's at 100%, you might benefit from additional Xvfb instances.

Lockout answered 11/6, 2012 at 20:56 Comment(4)
Cool. I have a i7 quad-core. I'm rendering around 50 web pages per second. I didn't know about the -noreset option, my (16GB) memory was maxing out every 45 minutes. My dirty fix was to cron killall Xvfb every 15 minutes. Thanks for that. My CPU hovers around 70% to 90% with one Xvfb server. With your information I'm thinking 4 servers in a round robin queue?Trothplight
Is the single Xvfb process taking 70% to 90% cpu? That's out of 400% right? So it's 70-90% of a single core?Lockout
Now that I look at it, it's my python scripts that are connecting to the Xvfb that are taking up the CPU. The xvfb server is around 3%. Yes, that's out of 400%.Trothplight
Yeah if xvfb is so low, 1 server should be fineLockout

© 2022 - 2024 — McMap. All rights reserved.