Slow chrome launch/navigation and high cpu usage when trying to launch multiple instances parallely

1,505 views
Skip to first unread message

Nish26

unread,
Sep 9, 2015, 9:20:18 AM9/9/15
to Selenium Users
Hi All,

When trying to run chrome driver , while i am able to launch multiple copies of chrome almost instantly , total time from launch to  navigate action takes a long time which is directly related to number of instance i have launched in parallel. 
I need to run my test cases on multiple instance of chrome at the same time[10-15 instances or even more]. While Slow chrome launch/navigation is unacceptable , high CPU usage by chrome does not allow me to continue smoothly with my test cases. Any help in these two areas would be appreciated.

Observations:
Single instance launch + Navigate : 3993 ms
Two instances launch + Navigate : 6102 ms
Three instances launch + Navigate : 14685 ms
Four instances launch + Navigate : 16125 ms
and so on. Also , CPU usage increased to 100%[usage by chrome as seen in task manager] when number of chrome instances launched by chrome driver  are 3 or more in my case.

Sample code to reproduce issue  [C# console project ] :
static void Main(string[] args)
{
   Parallel.For(1, n, i =>
        {               
            IWebDriver driver = new ChromeDriver(@"D:\SeleniumDrivers");              
            driver.Navigate().GoToUrl("http://www.bing.com");               
        });
}
Run for various values of "n>=2" and see the difference in time it takes to navigate all instances of chrome that has been launched.Also, observe the CPU utilization of chrome instances launched by chrome driver.

Environment details:
OS : Windows 8 Enterprise (64-bit)
Chrome version :  44.0.2403.89 m (64-bit)
WebDriver version :  2.46
ChromeDriver version : 2.15.322448

Regards,
Nish26

Shawn McCarthy

unread,
Sep 9, 2015, 10:21:13 AM9/9/15
to Selenium Users
Maybe not related, but Chromedriver 2.15 says it only supports up to Chrome 43 (https://chromedriver.storage.googleapis.com/2.15/notes.txt). Have you tried ChromeDriver 2.16, 2.17, 2.18, or 2.19 ?

MWQA

unread,
Sep 10, 2015, 7:10:09 AM9/10/15
to Selenium Users
Might be Chrome. Version 45 is meant to be signifcantly better at memory mangement - assuming there is a ChromeDriver version released which supports Chrome v45

Nish26

unread,
Sep 10, 2015, 7:41:22 AM9/10/15
to Selenium Users
I tried with ChromeDriver 2.19 . Chrome browsers are not holding up the CPU anymore . However, i could not see any major improvement in parallel launch time. It's still taking time based on the number of instances of chrome i launch . Also, i can see spikes in CPU usage during launch and whenever i try to do some automation on chrome. In my case CPU usage is still going up to 100% with just 3-5 browsers.

MWQA

unread,
Sep 10, 2015, 7:47:10 AM9/10/15
to Selenium Users
Maybe try Selenium Grid for this sort of thing?  I use multiple Jenkins jobs against Sauce labs personally

Nish26

unread,
Sep 10, 2015, 8:47:53 AM9/10/15
to Selenium Users
I will definitely give Selenium Grid a try. 
Anyways even after upgrade , still in some cases , chrome browser keeps using up to 40% CPU for a while [up to 1 min in some cases] after automation has completed. Eventually , CPU usage drops to normal. I will also try to upgrade to chrome version 45 and check with that.

Aaron Shaver

unread,
Oct 22, 2015, 1:10:51 AM10/22/15
to Selenium Users
Nish,

I wanted to chip in and say I have this same problem at my company. We run 4 Selenium tests in parallel on a beefy Azure VM (8 cores) and experience massive CPU use when they run. I'm running ChromeDriver 2.20, the latest stable version, and Chrome 46, again latest stable, so I don't think it's anything that's been fixed recently.

-Aaron


On Wednesday, September 9, 2015 at 6:20:18 AM UTC-7, Nish26 wrote:

MWQA

unread,
Oct 22, 2015, 8:46:38 AM10/22/15
to Selenium Users
I'm not sure how you are running your tests but if you currently start ChromeDriver in your test setup and your teardown stop ChromeDriver, you could alternatively (I believe), start ChromeDriver using the .exe, then configure the remote url to the port number that the server is running on... you'd just need to remember to kill the Driver manually when your tests finish.  I think Dave Haeffner has posted something like that previously if you wanted to search for it

yax...@gmail.com

unread,
Jan 29, 2016, 3:18:34 AM1/29/16
to Selenium Users
I am facing same problem. Is this problem related to chrome driver(currently i am using chrome driver 2.20)?  
Reply all
Reply to author
Forward
0 new messages