Max sessions

312 views
Skip to first unread message

micha...@numerator.com

unread,
Dec 6, 2018, 11:23:11 PM12/6/18
to Selenium Users
Hello,

I was wondering what is the max sessions on a standalone docker image, if any?

Specifically, I am using standalone-chrome:3.141.59-bismuth and was wondering if it is limited to a maximum number of session or I can set something in an environment variable like...

docker run -d -p 4444:4444  --name=selenium-grid -e NODE_MAX_SESSION=3 -v /dev/shm:/dev/shm selenium/standalone-chrome:3.141.59-bismuth

I want to run this docker on an ec2 instance and don't want it to kill the instance by running too many sessions at the same time.

Mike

Diego Fernando Molina

unread,
Dec 7, 2018, 1:01:31 PM12/7/18
to Selenium Users
Hi Mike,

The docker images are configured to run one browser per container, this through the "maxSession" parameter, which is set to 1. The idea of it is to isolate as much as possible the environment for every test.
Nevertheless, it is possible to overwrite that with the variable you mention to any value that works for you, see https://github.com/SeleniumHQ/docker-selenium/blob/master/NodeBase/Dockerfile#L107

In the end, it is an exercise of finding the right number for your environment. Some people run more than one session per container, some don't, and this all depends on how much ram and cpu you have available. Also how heave the website you are testing is.

Cheers,

Diego

Michael Yee

unread,
Dec 7, 2018, 1:22:37 PM12/7/18
to seleniu...@googlegroups.com
Hello Diego,

If I was to use a grid using a hub/node, there are ways to set the max sessions.

In my case, if you run the standaone container and send tests to it, it is not limited to one session.

Mike

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b93efacc-976d-450e-8fc1-6ccae9a31bfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

⇜Krishnan Mahadevan⇝

unread,
Dec 10, 2018, 3:00:18 AM12/10/18
to Selenium Users
Michael,
Wouldn't you be better off with spawning a container that runs a selenium standalone for every test and cleaning up the container after the test is done, instead of trying to send all tests to the same standalone docker instance ?

Docker has restful apis using which you should be able to do this easily. All you would need to do is create a Wrapper around the browsers and in its constructor, write logic to spin up a docker container that matches with the capabilities, before delegating the call to the underlying constructor.

Of-course I am conveniently assuming that its Java that you are using.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ http://rationaleemotions.wordpress.com/


Diego Fernando Molina

unread,
Dec 21, 2018, 4:21:16 PM12/21/18
to seleniu...@googlegroups.com
Hi Michael,

Sorry for the late reply... The thing is that the Standalone role does not have the maxSessions parameter... So if you want to play with that, it would be necessary to get into the hub-node setup.

You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/F5aMcAIu4LU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Diego Fernando Molina
Reply all
Reply to author
Forward
0 new messages