Monthly Archive: September 2011

How to collect a Network Log for Google Chrome

Are you having some weird networking problems and want to report a bug to Google Chrome? The most helpful thing you can do to speed up the process is get a network log so that the Chromium team can have a better chance at diagnosing the problem.

In this tutorial, we will walk you through how to collect a Chrome Net-Internals log, and a WireShark Capture.

Pre-requisites:

What is Wireshark?

Wireshark is a tool for collecting network traffic.  This will allow the Chrome team to get a better idea of what might be causing the network issues.

Reduce Background Noise

Before attempting to make a network log, it is important to try to reduce the background noise.  Normally our computers have a number of programs running in the background, many of which are connecting to external sources.  To give yourself the best chance for success, turn off all unnecessary programs, for the duration of the log.  After you finish, feel free to turn everything back on.

Collecting the Logs

To collect your network logs, perform the following steps:

  1. Close Google Chrome and all it’s windows
  2. Restart Google Chrome (if it isn’t already open)
  3. Open the Net-internals page in a new window or tab (make sure to leave this open) using the following address:
    about:net-internals
  4. Open Wireshark
    1. From the Capture menu, select Interfaces
    2. Find the Description describing your network interface (It will likely have the growing number next to it). Press the Start button to the right of this connection
  5. Return to Google Chrome
  6. Open a new tab or window and perform whatever operation you want to log (For example, go to gmail.com if you want to demonstrate a slow loading behaviour). Continue until you feel you have a sufficient sample (in the case that it never completes)
  7. Open the net-internals page you left open.
    1. Under Dump data press the Dump to file button
    2. This log will be downloaded to your downloads folder
  8. Go to Wireshark
    1. From the Capture menu, select Stop
    2. From the File menu, select Save As…
    3. Enter a descriptive File name (for example ‘gmail-capture’) and for convenience, save it to a location you will remember (such as “My Documents”)

You will now have both a Google Chrome net-internals log, and a wireshark log. Make sure to keep track of where you saved them, and when appropriate, attach them to the bug report.

If you have any questions about this tutorial, please let me know.

Are Google’s Services Running Slow in Chrome? Try Disabling Spdy

Update: After further testing, the issue seems to be with the NSS-SSL library, rather than SPDY, however the steps below will still likely resolve your speed issues.

Update #2: I am no longer having this issue. It appears to be some odd interplay between the NSS-SSL protocol in Chrome/Firefox and the Traffic shaper at my University, that has since been reconfigured. This means that it is now more important than ever that if you’re experiencing this issue, to report it to the Google Chrome team.

Are you trying to connect to your Gmail, and it seems to take forever to connect? What about Google Docs? Google Plus? All of the above? It might not be Chrome that is the problem, but actually Google’s SPDY protocol behind the scenes.

So what is SPDY? It is a protocol that Google uses, where it keeps a single persistent connection to Google for all of your Google Accounts information. This is utilized by a number of Google Services, including Gmail, Google Docs, and most recently Google Plus. When this is working properly, it allows Google to do what Google does best: Speeding up the web. However, when it fails, it will bring down your Google world, in a thunder of Loading icons.

It it Google Chrome?

The most important first step is it make sure that the problem is actually Google Chrome. To do this, try a different web browser, such as Internet Explorer if you’re on Windows, or Safari if you’re on a Mac.

If you tried a different web browser and the problem still happens, then it is likely due to a different problem, such as a slow internet connection. If however tried the same thing in a different web browser, and it worked fine, then it is probably Google Chrome.

Google knows about this issue (I know, because helped provide information for one of the bug reports), but so far they haven’t narrowed it down.

Collect a log

If you are finding that you have a problem like this, then it might be useful to provide some details to the Chrome team so that they can hopefully make it better.  At this stage, this is optional, but highly encouraged.  This will be your best bet at getting any Google Chrome issues resolved though in the long run.  If you are willing to collect a log, you can do so by following my tutorial How to collect a Network Log for Google Chrome.

The Fix

Disclaimer: This fix is only temporary, and your best bet is to comment on the open Google Chrome Issue for this phenomena.

The good news is that there is a solution you can use for the problem (although it is temporary, as I will cover after). This wasn’t discovered by me, but rather one of my colleagues (Christoph Treude). Essentially what you have to do is disable spdy and Chrome’s enhanced SSL, which can be done using the following steps:

Windows

  • Right click on the short-cut you’re using to start Chrome
  • Select Properties
  • Modify Target from
    • ...\chrome.exe"

      into

    • ...\chrome.exe" --use-spdy=off --use-system-ssl

      (note: the command line arguments have to go after the quotation marks)

  • Click Apply
  • Close all Chrome windows
  • Restart Chrome

Mac

  • Open the terminal (In your Applications -> Utilities folder)
  • Type into terminal to change to Chrome’s Directory using:
    cd /Applications/Google\ Chrome.app/Contents/MacOS
  • Rename Google Chrome to Chrome in the terminal:
    mv Google\ Chrome Chrome
  • Copy the following 3 lines for the contents of our execution script:
    #!/bin/sh
    # This will execute your Google Chrome with SPDY disabled, and set it to use your System SSL
    /Applications/Google\ Chrome.app/Contents/MacOS/Chrome --use-spdy=off --use-system-ssl
  • Type the following into the Terminal to make a file from what you just copied:
    pbpaste > Google\ Chrome
  • Type the following into the terminal to it so our new Google Chrome can run:
    chmod +x Google\ Chrome
  • Close Google Chrome using the Apple menu, or Command-Q:
  • Restart Google Chrome

If you had this problem and this solution worked for you, I would recommend you add your voice to the discussion on the bug, as during my last correspondence, they suggested that this might be a problem localized to my network (which it might, but I suspect it isn’t). This solution is only temporary, as if you end up creating a new shortcut somewhere, or you update Google Chrome, you will likely have to redo the fix, or the problem may come back.

Collect a Log (If you didn’t above)

If you found this solution worked for you, but you didn’t collect a log above, perhaps now would be a good time to do so.  However, first we will have to disable the fix above (as the problem will not exhibit itself while the fix is in place). Don’t worry, once you have your log, you can easily turn it back on using the steps above.

Disable fix on Windows

  • Right click on the short-cut you’re using to start Chrome
  • Select Properties
  • Modify Target from
    • ...\chrome.exe" --use-spdy=off --use-system-ssl

      into

    • ...\chrome.exe"
  • Click Apply
  • Close all Chrome windows
  • Restart Chrome

Disable Fix on Mac

  • Open the terminal (In your Applications -> Utilities folder)
  • Type into terminal to change to Chrome’s Directory using:
    cd /Applications/Google\ Chrome.app/Contents/MacOS
  • Rename Chrome back to Google Chrome in the terminal:
    mv Chrome Google\ Chrome
  • Close Google Chrome using the Apple menu, or Command-Q:
  • Restart Google Chrome

Collecting the Log on Both

So you’ve decided to help out? I’m glad, this will increase both of our chances at having this resolved.  As I mentioned above, you can collect your Network Log by by following my tutorial How to collect a Network Log for Google Chrome.

Submit to the Issue

If you found that this worked for you, you’re not alone, but unfortunately, as I mentioned above, this solution is only temporary, and you will likely need to redo it the next time you update Google Chrome, or change your shortcuts.  So perhaps now would be a good time to help Google Chrome find a long term solution.   There is already an open issue for Google Chrome about this phenomena, and you can easily submit your information to that issue.  If you need help doing so, let me know, but the Network Logs mentioned above would be highly beneficial to this process.

Could this be better?

So what do I think would be a better solution? For the most part, the average user doesn’t even know what Google Chrome is doing behind the scenes.

The solution above would work, but it isn’t exactly, user friendly. I suggested that in a case like this, perhaps after a few seconds of attempting to connect with SPDY (Google themselves have suggested that users spend less time at slow pages), and not getting any data (which Will Chan said was the case in my case), maybe it would be a good opportunity to say to the user that it’s failing to connect with one method, and to attempt connecting with another.

In this case, the system could try something like the solution above does, disable spdy and ssl, and try then. Sure it’s not a perfect solution, but unless you have to do something explicitly in Chrome (which few people do), this would probably stop you from Switching to an alternative browser.