On Sun, May 20, 2018 at 4:58 PM, Felix Wolfheimer <[email protected]>
wrote:

> Hi Nick,
>
> thanks for your answer. Yes, I was talking about VNC sessions on Linux.
>  The scenario I have in mind is a cloud deployment with auto-scaling
> functionality:
>
> There's one instance where guacamole is installed. This instance is
> small, cheap, and runs 24/7. The applications used in the VNC sessions
> require decent 3D rendering performance and, thus, I want to host them
> on GPU instances. These instances are expensive and so I would like to
> only spin them up when there's demand for a session. I have a mechanism
> that can submit a script (which creates a VNC session) to a scheduling
> system (e.g. SLURM). This scheduling system is connected with an
> autoscaling mechanism, e.g., cfncluster, which starts session host
> instances if there's demand. The session starts on the new instance,
> and the session information is added to the guacamole_db.
> This is why I was thinking the it would be great to have a mechanism to
> trigger the submission of the session creation script to the scheduling
> system when a user logs in. As the start of an instance needs a moment,
> I would like to have some way to inform the user about what's going on
> in the background.
>


That makes sense.  You should be able to do something like this in a
Guacamole extension - monitor the number of users connected to a particular
connection or connection group, and then trigger something every time
there's a connect or disconnect.  I would imagine the most useful thing
would be event listeners:

http://guacamole.apache.org/doc/gug/event-listeners.html

If you trigger an action every time a connection is established or
terminated, you can scale it in such a way that you always have 1 or more
spare instances running (depending on how frequently and quickly you expect
users to connect), and that would do the trick.  If you wanted to go even
leaner than that, you could trigger it at user logon/logoff such that an
instance was started when a user logged on to Guacamole, and, if there was
sufficient time between logon and the user attempting to connect, this
might work, as well, without having to keep as many (any?) spare instances.

The other option is to use an external load balancer to accomplish this and
then just point Guacamole at the load balancer.  I'm all for implementing
cool extensions for Guacamole, but this may have some benefits,
particularly in cloud-type environments where you're given these tools.
I'm thinking of AWS where you can do EC2 + Elastic Load Balancer (ELB) and
ELB will actually manage the number of spare EC2 instances for you.  The
plus side to this is that, at least in the case of AWS, it's already
implemented.  You can also do some similar stuff with a load balancer like
HAProxy, where you can look at the current user count vs. maximum count and
start up or shut down instances with a script of some sort based on that.
I've done this in the past and it worked reasonably well.

Anyway, plenty of possibilities for you - post back and let us know what
you do and how it works!

-Nick

Reply via email to