vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Slow response when system is offline

Open okian opened this issue 10 years ago • 23 comments

When system is connected to network but don't have access to internet (just local network) navigation, move , copy , rename in directories and files become very slow. it's happening periodically and seems like it's waiting for kind of timeout.

image

okian avatar Dec 04 '15 04:12 okian

@moostad when this happens can you open chrome tools (Help > Toggle Developer Tools), open the Profile tab and run a CPU profile to see where the time is spend?

bpasero avatar Dec 04 '15 09:12 bpasero

@bpasero I don't see any problem in CPU profile (or most likely I'm not qualified to read it) but I can send it to you if it can help. the only thing I noticed is every time that's happening two error will print in console.

1: Error: getaddrinfo ENOTFOUND vortex.data.microsoft.com vortex.data.microsoft.com:443 at errnoException (dns.js:25:10) at GetAddrInfoReqWrap.onlookup as oncomplete

2: Error: getaddrinfo ENOTFOUND dc.services.visualstudio.com dc.services.visualstudio.com:80 at errnoException (dns.js:25:10) at GetAddrInfoReqWrap.onlookup as oncomplete

okian avatar Dec 04 '15 10:12 okian

btw - this is issue #1000 :tada:

jrieken avatar Dec 04 '15 10:12 jrieken

@moostad if you are able to capture a CPU profile when the explorer shows the spinning progress you can send it to me.

I think the ENOTFOUND is from our telemetry reporting. @SofianHn any chance this could slowdown operations? We don't send telemetry sync do we?

bpasero avatar Dec 04 '15 10:12 bpasero

@bpasero we don't send telemetry sync, those errors are expected to be on the console. I just tried to reproduce it with no luck.

@moostad please try disable telemetry as described here and let us know if you see any difference.

sofianhn avatar Dec 04 '15 18:12 sofianhn

@bpasero here's the CPU profile. CPU-20151204T235311.cpuprofile.zip

okian avatar Dec 04 '15 20:12 okian

@SofianHn I disabled telemetry for about an hour and problem solved and as soon as I enabled that again, I get spinning progress 4 times in less than 10 minutes.

okian avatar Dec 05 '15 00:12 okian

Interesting...thanks @moostad for the quick response. I am guessing you are on Mac, after being offline for a while please run open $TMPDIR/appInsights-node from the terminal and verify what exists in this directory. You should see a bunch of json files, I am interested how many and what's their sizes.

@bpasero I verified that the caching mechanism by AppInsights is async. My guess now that it might be writing to the disk too often ~15 seconds which might be causing this issue. I will take it from here.

sofianhn avatar Dec 05 '15 01:12 sofianhn

@SofianHn I will send those information later however I'm not sure that have anything to do with writing because I don't get spinning when system is disconnected from network (wifi is off) it's happening only when my mac is connected to the network without internet. I guess when it's see network connection then try to connect to website, at this time everything is blocked and I get spinning until that get http timeout.

p.s. I have no problem to understanding (reading and listening) English but writing and speaking is another story, so sorry about my poor English.

okian avatar Dec 05 '15 02:12 okian

@SofianHn this time I tried on Ubuntu to be sure it's not OS/Device related, it's happening but not as often and not as long as Mac. maybe because it has much more power then the Mac (2x raid0 SSD for OS, 12 core CPU, 32 GB ram)

Here's the list of files

Total size: 1.5 MB Count : 43

  45K Dec  5 11:16 1449301590361.ai.json
  21K Dec  5 11:16 1449301607507.ai.json
  44K Dec  5 11:17 1449301669096.ai.json
 8.0K Dec  5 11:18 1449301685054.ai.json
  28K Dec  5 11:18 1449301701515.ai.json
  28K Dec  5 11:18 1449301722262.ai.json
  14K Dec  5 11:19 1449301741035.ai.json
  18K Dec  5 11:19 1449301757832.ai.json
 5.4K Dec  5 11:19 1449301776224.ai.json
  65K Dec  5 11:20 1449301804942.ai.json
  54K Dec  5 11:20 1449301820250.ai.json
  19K Dec  5 11:20 1449301854519.ai.json
  17K Dec  5 11:21 1449301877099.ai.json
  26K Dec  5 11:21 1449301897507.ai.json
  16K Dec  5 11:21 1449301913055.ai.json
  20K Dec  5 11:22 1449301928942.ai.json
  18K Dec  5 11:22 1449301946785.ai.json
  46K Dec  5 11:22 1449301975527.ai.json
  23K Dec  5 11:23 1449301990779.ai.json
  43K Dec  5 11:23 1449302007367.ai.json
  52K Dec  5 11:23 1449302031358.ai.json
  15K Dec  5 11:24 1449302047260.ai.json
  46K Dec  5 11:24 1449302067154.ai.json
  41K Dec  5 11:24 1449302082161.ai.json
  54K Dec  5 11:25 1449302107280.ai.json
  37K Dec  5 11:25 1449302122366.ai.json
  17K Dec  5 11:25 1449302142179.ai.json
  35K Dec  5 11:25 1449302159539.ai.json
  34K Dec  5 11:26 1449302182334.ai.json
 5.4K Dec  5 11:26 1449302198281.ai.json
  25K Dec  5 11:26 1449302215101.ai.json
  38K Dec  5 11:27 1449302231171.ai.json
  25K Dec  5 11:27 1449302248680.ai.json
  35K Dec  5 11:27 1449302264804.ai.json
  19K Dec  5 11:28 1449302280982.ai.json
  66K Dec  5 11:28 1449302299938.ai.json
  69K Dec  5 11:28 1449302315167.ai.json
  37K Dec  5 11:28 1449302330401.ai.json
  31K Dec  5 11:29 1449302349368.ai.json
 9.5K Dec  5 11:29 1449302369790.ai.json
 6.8K Dec  5 11:29 1449302399153.ai.json
  80K Dec  5 11:30 1449302418946.ai.json
  22K Dec  5 11:30 1449302433991.ai.json

okian avatar Dec 05 '15 08:12 okian

thanks @moostad for the clarification and the list of files. The update rate and the size of files seems reasonable to me, writing 3 small files a minute should not be a problem. Now that IO is less likely to have caused this, I will work on producing the case with network and without internet to see what might be going wrong here.

You english is great btw, we really appreciate working with us to get this issue fixed.

sofianhn avatar Dec 05 '15 20:12 sofianhn

The electron folks confirmed the issue on their side. Until this issue get fixed in electron and we get the new build, the workaround is to disable telemetry.

sofianhn avatar Dec 11 '15 17:12 sofianhn

We will not update to a new electron build for the December update. Therefore I'm moving the milestone to January.

The work around for how to disable telemetry is document here: https://code.visualstudio.com/Docs/supporting/FAQ#_how-to-disable-telemetry-reporting

egamma avatar Dec 16 '15 10:12 egamma

Nothing happened in February for this. Ping @SofianHn

joaomoreno avatar Feb 24 '16 16:02 joaomoreno

I pinged in the upstream, still waiting

sofianhn avatar Mar 16 '16 00:03 sofianhn

We will not update to a new electron for March, shifting to April

egamma avatar Mar 17 '16 14:03 egamma

This is super super bad, I just hit this while in transit. We have to do something about it for April, it feels you are sitting in front of a web browser that tries to connect to the file that is on disk.

bpasero avatar Apr 22 '16 13:04 bpasero

@Microsoft/vscode to get some attention and maybe collect ideas. We could maybe:

  • take out telemetry from the critical path of opening a file
  • detect that the system is offline and just not try to connect (Electron has APIs for this)

bpasero avatar Apr 22 '16 13:04 bpasero

+2 the telemetry service should not run in the main thread but like search and fs watch in a separate process

jrieken avatar Apr 22 '16 13:04 jrieken

as an easy workaround we can use a setTimeout trick here to get off the critical path.

jrieken avatar Apr 22 '16 13:04 jrieken