Hello, recently I upgraded php tools for vscode and it's become completely unusable. It locks up vscode when I try to scroll, open files, make edits, pretty much every action. I'll have to disable it for now.

Here is some more info on my setup:

PHP Tools- v1.31.12755
VSCode - 1.76.1
MacOS: Ventura 13.1
Chip: Apple M1 Pro

I also tried the latest release version of php tools with no luck.

I don't have any other extensions involving PHP.

Has anyone else encountered this issue? What can I do to resolve this? I love PHP Tools!

franklin113 Thank you for reporting that!

We haven't encountered the issue, but we're aware of high memory usage on macOS (which might cause system freezes) - but we can't replicate the issue on our machines. We'd be happy to fix this, so any information leading to this will be helpful.

    OK, I'll get more info. In the meantime, is there any way to disable individual features in PHP tools?

      Is there a way to disable certain folders from PHP tools' scope?

        9 days later

        franklin113 Hello - may I ask if you have any other information?

        Some users reported there were processes spawned by vscode using 100% CPU; we have eliminated them in the recent release, so that should help.

          a year later

          this extension is completely destroying the vps servers, just by connecting to it

          wewemo4973 Thank you very much for reporting the issue and the details. I'm sorry for the trouble.

          There is supposed to be just ONE devsense.php.lsp process.

          May I ask how many VSCode instances do you have? Is there any error in VSCode OUTPUT / PHP Language Server?

            JakubMisek The processes start spawning as soon as i start the VSCode remote SSH to the server (single instance) :( i get no output, VSCode just shows that remote desktop is loading (while i can view the files, slower and slower, until server stops responding completely from the spawned processes)

            The thing is, i don't even have php devsense installed, i have a fresh install of VSCode on my local notebook. This must be some extension that was used by a collegue that connected to the server from his own notebook. Also, when i tried to actually install the extension, and restarted the server/my local vscode, it did the same thing and spawned multiple processes eating cpu

              wewemo4973 thank you,

              the process seems to be in an infinite loop while indexing the user's code. We need to find what piece of user's code causes it.

                It's a vps server where we have multiple instances of dev versions of regular Laravel applicatoins - no special voodoo projects (no infinite symlinks or something). just basic normal websites, with basic model administration.

                But it's a server where there's 10+ of these, and i've noticed that the devsense starts spawning processes RIGHT AFTER CONNECT, not only after i open a file of a project that would be of my interest to scan. so i guess if it aggresively scans everything on the server without user consent it could cause problems even if there was no infinite loop

                wewemo4973 I see, yes, the process starts if the workspace contains a .php file - we should be less aggressive in this case.

                  wewemo4973 Are there also 10+ users connected to the same dev machine? Or the number of processes is larger than number of connected VSCodes?

                    JakubMisek no, just me, i was testing this during the weekend - i have restarted the vps in provider panel, connected to it (single user) and then the processes started spawning

                      wewemo4973 thank you for testing it.

                      Have you been opening/closing folders in VSCode?

                      Is there any error in VSC OUTPUT -> PHP Language Server:

                      I'll be trying to reproduce the issue and fix it ASAP.

                        JakubMisek thank you

                        i am not sure now:( because i have uninstalled the VSCode from my machine after testing, rm -rfed the ~/.vscode-server from all of our VPSes, and told my collegues not to use the extension so it wouldn't crash our servers (the 100% cpu usage happeend more times, i just had time to look at the problem this weekend)

                        regarding the folders, when testing for the first time i did open and close folders while browsing the server, but i am pretty sure that when i re-tried doing it after restarting the server more times it was enough just to connect to the server (and i had a random .php file from one project folder pre-opened)

                        to try to simulate the environment - the tested VPS in question i ssh'd to was Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-117-generic x86_64), 2 Intel vCPUs, 4 GB RAM. it is a vps managed on forge, so there is one forge user that holds (mostly laravel, some basic php projects) in structure `/home/forge/{domain}/. this user is also the user users login as via ssh

                          wewemo4973 Thank you very much for the details.

                          We'll try to replicate the environment;

                          A side question - would it make sense to you and your organization, if the language server would run just a single process shared by all the users?

                            I am not exactly a sysadmin by trait, so iam not in a good position to konw the implicatoins it would have on security/performance/pitfalls to be honest :/

                              wewemo4973 Currently, VSCode always creates a new language server process for each user's VSCode window.

                              So if you have more users (N) for the same docker container, this would consume N-times less memory :)

                                Write a Reply...