Bad performance with multiple DevContainer, the secret setting

Answered

Hello,

i am working with many different and old web projects, almost written in PHP. That's why i prefer “devcontainers”, because every project have different dependencies (organized with docker-compose, using devcontainers “dockerComposeFile” property).

But every time i start a devcontainer, PhpStorm scan the whole project, all files (thats sucks, need a lot of time) and i need also to re-download driver files again to use PhpStorm internal Database browser.

Now i have found this setting, but in a different context: devcontainers.use.separate.project.panel
Found in this thread: https://intellij-support.jetbrains.com/hc/en-us/community/posts/19485533579794/comments/19493360762514

This fix my problem, so PhpStorm seems to remember everything and keep drivers. Any idea why? I cant find some description for this setting!

Host: PhpStorm 2026.1.1, Docker CE, Manjaro Linux

0
13 comments

Hello, Paul.

Could you please specify how exactly you start the dev container? Do you build it from scratch every time or start already built dev container from the Welcome screen/File | Remote Development… window? Did you have the Choose the backend version automatically option enabled in the Settings | Advanced Settings window before? 

0

Interesting questions!

Usually i start my dev containers from service tool window  (Service → Docker → Dev Containers → start container (Context menu)). But when it doesn't exist, I create the dev container using the context menu on my devcontainer.json because from Welcome screen/File | Remote Development don't work (i guess a bug, some java stack trace or similar appears)

Choose the backend version automatically: yes

0

Thank you for the update. 
I believe that due to the Choose the backend version automatically option being enabled, your IDE backend was updated (downloaded from scratch) every time a new version is added to our feed. Simply disabling this option should've helped, too; the re-scanning of the project most likely happened because the new IDE backend version used the new caches directory (it is an expected behavior).

0

Olga Mulina i will double check this option and maybe it solves theses problems too.

But i have these problems really every time after PHPStorm is started, not even after a new Version is released.

0

Olga Mulina problems are gone, even without setting devcontainers.use.separate.project.panel = true or uncheck Choose the backend version automatically.

I really don't know what happened, but actually i don't need to change anything. That is weird!

0

Thank you for the update; please let me know if the problem resurfaces again or if you have any further questions. 

0

Hello Olga Mulina and sorry for adding a new question here, but I have had similar problems to OPs and thought this thread kinda fits my needs. I am working on Intellij IDEA in WSL2. Creating a devcontainer always results in the IDE re-analysing the code and the jdk, and it takes ages on my PC. Now, is it the correct /recommended approach to create the devcontainer once and reuse it, say the next day, instead of always choosing “Create Devcontainer”? I assume this could be my problem, since the paths the IDE has to index and analyze always contain the custom container ID.

0

Vali i would recommend to start the devcontainer from services windows (and then using the "Open Project" button)

not via “Reopen in Container” popup that appears after starting local IDE and not using the context menu “Create Devcontainer…” on devcontainer.json file!

1

Hello, Vali.

Could you please specify what exactly you mean by IntelliJ IDEA in WSL2? Did you install the IDE inside WSL? If so, please note that we don't officially support the scenario. If you want to use Docker in WSL, you still can do it from the IDE installed on Windows; you can also consider checking the performance of dev containers with the Open dev container projects natively option enabled in Settings | Advanced Settings.

Regarding reopening the existing container - as Paul mentioned above, you can do it either via the Services view or via the File | Remote Development… window.

0

Olga Mulina sorry for the missing info. I have Intellij installed on my Windows. My project source code lives in the WSL2. I wonder, there exists an option “Open WSL projects natively” and as you said “Open dev container natively”. What is the recommended way here? Say I open my project stored in WSL first to create the devcontainer. Here it depends on the above setting if Intellij downloads the backend and client code or if it opens it natively, that's what I understand. Now from this window I want to create/start and connect to the devcontainer. This would also open natively if I check the box above. But this window would be Intellij client not native Intellij as far as I understand. So what's the best way to do this? Or am I misunderstanding somethg?

 

Thank you both for the help already.

0

Vali best recommendation i can give so far: Don't use WSL2! If you have Windows Pro, then install Docker for Windows on Hyper-v instead of WSL2. The performance of WSL2 file sync is terrible!

0

I wonder, there exists an option “Open WSL projects natively” and as you said “Open dev container natively”. What is the recommended way here?

The options you mentioned are different: one concerns opening WSL projects directly in the IDE without dev containers, and the second one is specific to the dev containers; also, the first one applies only to the projects opened via the Remote Development node on the Welcome screen/File | Remote Development… | WSL menu. If you just open the WSL project the same way as you do with the Windows project, it is already opened in native mode. 

 

Now from this window I want to create/start and connect to the devcontainer. This would also open natively if I check the box above. But this window would be Intellij client not native Intellij as far as I understand.

If the native mode for dev containers is enabled, the Remote Development feature you mentioned (IntelliJ client) is not used; it is the main difference between the modes. The project from dev cotnainer will be opened in your local IDE instead.

0

Thank you very much Olga Mulina . This definitely cleared things up a bit.

0

Please sign in to leave a comment.