<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=T2BBot</id>
	<title>T2B Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=T2BBot"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/Special:Contributions/T2BBot"/>
	<updated>2026-09-15T14:01:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=VSCode&amp;diff=1443</id>
		<title>VSCode</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=VSCode&amp;diff=1443"/>
		<updated>2026-09-08T12:14:23Z</updated>

		<summary type="html">&lt;p&gt;T2BBot: sync from iihe-scripts docs/user (wiki-push)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= VS Code on the /user CephFS filesystem — reduce your metadata load =&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Why this matters ==&lt;br /&gt;
&lt;br /&gt;
The shared /user area is a CephFS filesystem served by a single metadata server (MDS). Ordinary editor operations (stat, ls, open, reading directory entries) turn into &#039;&#039;metadata requests&#039;&#039; that the MDS must serve for &#039;&#039;all&#039;&#039; users — on the login machines &#039;&#039;and&#039;&#039; on the worker nodes. A few VS Code features are notoriously chatty:&lt;br /&gt;
&lt;br /&gt;
* the &#039;&#039;file watcher&#039;&#039; polls watched directories in the background;&lt;br /&gt;
* &#039;&#039;Pylance&#039;&#039; (the Python language server) indexes and scans the whole workspace;&lt;br /&gt;
* the &#039;&#039;npm / task auto-detection&#039;&#039; runs a recursive search for package.json files across the whole tree.&lt;br /&gt;
&lt;br /&gt;
When several people have such sessions open, the MDS saturates: simple operations that should take ~10 ms take seconds, for everyone. This page tells you how to reduce your own contribution.&lt;br /&gt;
&lt;br /&gt;
== Open a project folder, not your whole home — the most important step ==&lt;br /&gt;
&lt;br /&gt;
The single biggest source of metadata requests is opening your &#039;&#039;whole home directory&#039;&#039; (&amp;lt;code&amp;gt;/user/&amp;amp;lt;your-username&amp;amp;gt;&amp;lt;/code&amp;gt;) as the VS Code workspace. When the workspace root is your home, VS Code&#039;s file watcher and language server keep an eye on and scan &#039;&#039;everything&#039;&#039; you have. No amount of settings can fix that — the config below helps, but only if the workspace is a specific project folder.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;What to open:&#039;&#039;&#039; a project folder, e.g. &amp;lt;code&amp;gt;/user/&amp;amp;lt;your-username&amp;amp;gt;/&amp;amp;lt;project&amp;amp;gt;&amp;lt;/code&amp;gt;, not your home.&lt;br /&gt;
* &#039;&#039;&#039;How:&#039;&#039;&#039; &amp;lt;code&amp;gt;File → Open Folder…&amp;lt;/code&amp;gt; and pick the project directory.&lt;br /&gt;
* &#039;&#039;&#039;How to tell what&#039;s open:&#039;&#039;&#039; the folder shown in the top-left corner of the window is the workspace root. If it is just your username (&amp;lt;code&amp;gt;/user/&amp;amp;lt;you&amp;amp;gt;&amp;lt;/code&amp;gt;) rather than a project folder, that is the problem.&lt;br /&gt;
* &#039;&#039;&#039;After changing:&#039;&#039;&#039; Command Palette (&amp;lt;code&amp;gt;Ctrl+Shift+P&amp;lt;/code&amp;gt;) → &amp;lt;code&amp;gt;Developer: Restart Extension Host&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This one change does more to keep the shared area fast than all the other settings on this page combined.&lt;br /&gt;
&lt;br /&gt;
== Server-side baseline (admin-managed, janitor) ==&lt;br /&gt;
&lt;br /&gt;
The admins deploy a &#039;&#039;baseline&#039;&#039; of the settings below into every account on the mX login machines via a janitor script. Two things to know:&lt;br /&gt;
&lt;br /&gt;
* It is injected only &#039;&#039;if your file does not exist yet&#039;&#039;: &amp;lt;code&amp;gt;~/.vscode-server/data/Machine/settings.json&amp;lt;/code&amp;gt;. Existing files are &#039;&#039;&#039;never&#039;&#039;&#039; overwritten, so anything you have already configured stays yours.&lt;br /&gt;
* About 15 users currently already have their own file. For those, nothing is injected — see the section below: &#039;&#039;I already have a settings.json — what do I need to check?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Where to put the settings ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Recommended (per project, versioned):&#039;&#039;&#039; create a file &amp;lt;code&amp;gt;.vscode/settings.json&amp;lt;/code&amp;gt; at the root of your project and paste the settings there. It only affects that project.&lt;br /&gt;
* &#039;&#039;&#039;Your account on one machine (overrides / complements the baseline):&#039;&#039;&#039; Command Palette → Preferences: Open Remote Settings (SSH: mX) → switch to the JSON editor.&lt;br /&gt;
* &#039;&#039;&#039;Baseline (managed by admins, do not delete):&#039;&#039;&#039; &amp;lt;code&amp;gt;~/.vscode-server/data/Machine/settings.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After applying: Command Palette → Developer: Restart Extension Host.&lt;br /&gt;
&lt;br /&gt;
== Complete settings.json ==&lt;br /&gt;
&lt;br /&gt;
The file below is commented and safe to paste as-is. Replace &#039;&#039;&amp;lt;your-username&amp;gt;&#039;&#039; and &#039;&#039;&amp;lt;project&amp;gt;&#039;&#039; with your own values where indicated. Settings in this file are pure JSON-with-comments (VS Code accepts them).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  // ---- 1. File watching (the single biggest source of metadata requests) ----&lt;br /&gt;
  // Never watch generated, dependency or cache directories.&lt;br /&gt;
  &amp;quot;files.watcherExclude&amp;quot;: {&lt;br /&gt;
    &amp;quot;**/.git/objects/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.git/subtree-cache/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/node_modules/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/__pycache__/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.mypy_cache/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.pytest_cache/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.ruff_cache/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.venv/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.conda/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/*.egg-info/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/build/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/dist/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/htmlcov/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.cache/**&amp;quot;: true&lt;br /&gt;
  },&lt;br /&gt;
  // Optional: whitelist ONLY the directories you actually edit.&lt;br /&gt;
  // Leave the array empty to keep the default (watch everything except the&lt;br /&gt;
  // excludes above). If you fill it, only these paths are watched at all.&lt;br /&gt;
  &amp;quot;files.watcherInclude&amp;quot;: [&lt;br /&gt;
    &amp;quot;/user/&amp;lt;your-username&amp;gt;/&amp;lt;project&amp;gt;/src&amp;quot;&lt;br /&gt;
  ],&lt;br /&gt;
&lt;br /&gt;
  // ---- 2. Pylance / Python language server ----&lt;br /&gt;
  // &amp;quot;default&amp;quot; keeps basic IntelliSense; &amp;quot;none&amp;quot; disables it completely&lt;br /&gt;
  // (cheapest option).&lt;br /&gt;
  &amp;quot;python.languageServer&amp;quot;: &amp;quot;default&amp;quot;,&lt;br /&gt;
  // Analyse only the files you have open, not the whole workspace.&lt;br /&gt;
  &amp;quot;python.analysis.diagnosticMode&amp;quot;: &amp;quot;openFilesOnly&amp;quot;,&lt;br /&gt;
  // No background workspace index.&lt;br /&gt;
  &amp;quot;python.analysis.indexing&amp;quot;: false,&lt;br /&gt;
  // No automatic import searches across the tree.&lt;br /&gt;
  &amp;quot;python.analysis.autoSearchPaths&amp;quot;: false,&lt;br /&gt;
  &amp;quot;python.analysis.autoImportCompletions&amp;quot;: false,&lt;br /&gt;
  &amp;quot;python.analysis.useLibraryCodeForTypes&amp;quot;: false,&lt;br /&gt;
&lt;br /&gt;
  // ---- 3. npm / task auto-detection ----&lt;br /&gt;
  // This is what launches the recursive `rg --files -g **/package.json`&lt;br /&gt;
  // scans. Turn it off unless you actively use the NPM Scripts panel.&lt;br /&gt;
  &amp;quot;npm.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;task.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;gulp.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;grunt.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;jake.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  // ---- 4. Search (Ctrl+Shift+F) ----&lt;br /&gt;
  // Respect .gitignore so searches don&#039;t walk everything.&lt;br /&gt;
  &amp;quot;search.useIgnoreFiles&amp;quot;: true,&lt;br /&gt;
  &amp;quot;search.useGlobalIgnoreFiles&amp;quot;: true,&lt;br /&gt;
  &amp;quot;search.exclude&amp;quot;: {&lt;br /&gt;
    &amp;quot;**/.git&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/node_modules&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/__pycache__&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.venv&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/build&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/dist&amp;quot;: true&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  // ---- 5. Git ----&lt;br /&gt;
  // Don&#039;t re-stat the whole working tree in the background.&lt;br /&gt;
  &amp;quot;git.autorefresh&amp;quot;: false,&lt;br /&gt;
  // Disable Git integration entirely for repositories you don&#039;t need it on.&lt;br /&gt;
  &amp;quot;git.enabled&amp;quot;: true,&lt;br /&gt;
&lt;br /&gt;
  // ---- 6. Editor / autosave ----&lt;br /&gt;
  // Batch saves instead of writing on every keystroke.&lt;br /&gt;
  &amp;quot;files.autoSave&amp;quot;: &amp;quot;afterDelay&amp;quot;,&lt;br /&gt;
  &amp;quot;files.autoSaveDelay&amp;quot;: 5000&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== I already have a settings.json — what do I need to check? ==&lt;br /&gt;
&lt;br /&gt;
If your account already had a &amp;lt;code&amp;gt;~/.vscode-server/data/Machine/settings.json&amp;lt;/code&amp;gt; before the janitor went live, the baseline was &#039;&#039;&#039;not&#039;&#039;&#039; injected for you. Please open that file (or Preferences: Open Remote Settings) and make sure these keys are present. You can copy this minimal block and merge it into your existing file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;files.watcherExclude&amp;quot;: {&lt;br /&gt;
    &amp;quot;**/.git/objects/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/node_modules/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/__pycache__/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/.venv/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/build/**&amp;quot;: true,&lt;br /&gt;
    &amp;quot;**/dist/**&amp;quot;: true&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;python.analysis.diagnosticMode&amp;quot;: &amp;quot;openFilesOnly&amp;quot;,&lt;br /&gt;
  &amp;quot;python.analysis.indexing&amp;quot;: false,&lt;br /&gt;
  &amp;quot;npm.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;task.autoDetect&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
  &amp;quot;search.useIgnoreFiles&amp;quot;: true,&lt;br /&gt;
  &amp;quot;git.autorefresh&amp;quot;: false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the keys that matter most. Everything else in the full example above is optional tuning.&lt;br /&gt;
&lt;br /&gt;
== What each block does ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;code&amp;gt;files.watcherExclude&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;files.watcherInclude&amp;lt;/code&amp;gt;&#039;&#039;&#039; — stops the background file watcher from polluting cache/dependency folders, or restricts it to the few directories you edit. This alone removes the majority of requests from a typical session.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;code&amp;gt;python.analysis.*&amp;lt;/code&amp;gt;&#039;&#039;&#039; — Pylance walks the tree for imports and indexing. &amp;lt;code&amp;gt;openFilesOnly&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;indexing:false&amp;lt;/code&amp;gt; removes nearly all of that traffic while keeping completion in the files you have open.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;code&amp;gt;npm/task auto-detect off&amp;lt;/code&amp;gt;&#039;&#039;&#039; — removes the recursive package.json search.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;code&amp;gt;search.useIgnoreFiles&amp;lt;/code&amp;gt;&#039;&#039;&#039; — searches stop descending into ignored dirs.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;code&amp;gt;git.autorefresh:false&amp;lt;/code&amp;gt;&#039;&#039;&#039; — avoids background stat() storms on large repos.&lt;br /&gt;
&lt;br /&gt;
== Still slow? The strongest options ==&lt;br /&gt;
&lt;br /&gt;
* Keep only a light VS Code window on /user (watchers excluded) and do heavy work (search, indexing, big git operations) on a &#039;&#039;local scratch copy&#039;&#039; of the project under /tmp, copying results back when done.&lt;br /&gt;
* For very large source trees, work on local scratch entirely and treat /user as the results area only.&lt;br /&gt;
* Avoid opening your whole home directory (&amp;lt;code&amp;gt;/user/&amp;lt;your-username&amp;gt;&amp;lt;/code&amp;gt;) as the workspace root — open the specific project folder instead. This is the most important step; see &#039;&#039;Open a project folder, not your whole home&#039;&#039; above.&lt;/div&gt;</summary>
		<author><name>T2BBot</name></author>
	</entry>
</feed>