background

April 12, 2023

JetBrains Gateway for Magento development

Yireo Blog Post

While training Magento and Shopware developers, I've been exploring various products to enhance the course. I came across JetBrains Gateway and asked myself whether it would allow for developers to start coding without installing the application first.

Brief overview of JetBrains Gateway

JetBrains Gateway allows you to run PHPStorm on a server and then use the JetBrains Gateway client to connect to it using SSH. It sounds a bit similar to the option of PHPStorm to connect to a remote project using SSH. However, in this case, the actual program of PHPStorm is installed remotely as well. Cool stuff.

JetBrains, being the company behind PHPStorm and WebStorm, has more features that could be interesting. I played around with Code With Me (which got really crazy when 6 devs start collaborating on the same files). Obviously there are all the great plugins shipped within PHPStorm. And I've worked with tools like TeamCity and YouTrack briefly. There are plenty of tools, but when it came to JetBrains Gateway, I really felt that it could be used to overcome the problem of newcomers needing a working development environment before they could get started.

My setting

My actual trial with JetBrains Gateway started about half a year ago, when I was guiding a group of new Magento developers. And because almost all of them had laptops with bad specs (only 4Gb of RAM, no SSD drive, etcetera), I setup a VPS with 32Gb of RAM with plenty of SSD space. Next, I added a script to create user accounts, install & setup & configure Magento on the home-folder of that user, configure SSH authentication. I then supplied the student with the right SSH key.

Either by using the JetBrains Gateway stand-alone app or by using the Remote Development feature in PHPStorm, students were able to connect quickly and this proved to be a success. However, the more students were actively running on the same server, the slower things became (duh). It seemed 32Gb of RAM was not good enough.

Tuning performance

The simple recommendation for running PHPStorm via JetBrains Gateway is to have the same specs on the server as you would normally need on the client. So, with Magento, I often feel that you need at least 4Gb of memory assigned to the Magento project. Add to this the specs of PHPStorm itself, the MySQL database, PHP-FPM instance and a bit more, and I quickly concluded this required about 8Gb of memory. With 8 students, this added up to be 64Gb of RAM. As soon as the VPS was upgraded, the performance seemed to be ok on the server. Further tuning I looked into was tuning the heap size of Magento (-Xms and -Xmx), kernel tuning (maximum number of inodes, TCP/IP window tuning) and the cache warming of JetBrains itself.

However, another problem popped up: The students didn't have a great internet connection when working from home. And with the many Magento files that needed to be synced, this was a show-stopper. We went for a local environment instead.

Use a local environment instead

All in all, the problems remained: The laptops were not fast enough to work properly for local development and the internet connections were not fast enough for remote development. The actual solution was to upgrade the laptops (actually replace them with heavy-weight machines with 16Gb of RAM and SSD) and to push the students to get to the office to work from there (to solve the internet speed).

Installing Magento onto a local machine was not easy - almost all students were noobs and using Windows: Installing Docker Desktop, using WSLv2 to install an Ubuntu distribution and then kickstart the Magento installation via either a custom docker-compose setup, or Mark Shust his Docker scripts, or Warden. But all in all, it worked and in the end the students were happy to have installed things locally.

Does this mean that JetBrains Gateway is bad? No, not at all. But if you are trying to use it to overcome crappy laptops, I recommend spending time on replacing those laptops instead.

What about Fleet?

This all felt like an experiment - not only my own experiment but an experiment by JetBrains itself. In the meantime, JetBrains came up with another cool product called Fleet, primarily meant for collaboration and marked by JetBrains as their next-generation IDE. The remote features of Fleet are cool. But it is not PHPStorm, the PHP integration is yet lacking and the plugins that I need for proper Magento development are not there. All in all, Fleet sounds promising but is not yet an alternative to Magento developers (in my opinion).

Conclusion: JetBrains Gateway is slick but not fitting into my own training programs :o

Posted on April 12, 2023

About the author

Author Jisse Reitsma

Jisse Reitsma is the founder of Yireo, extension developer, developer trainer and 3x Magento Master. His passion is for technology and open source. And he loves talking as well.

Sponsor Yireo

Looking for a training in-house?

Let's get to it!

We don't write too commercial stuff, we focus on the technology (which we love) and we regularly come up with innovative solutions. Via our newsletter, you can keep yourself up to date on all of this coolness. Subscribing only takes seconds.

Do not miss out on what we say

This will be the most interesting spam you have ever read

We don't write too commercial stuff, we focus on the technology (which we love) and we regularly come up with innovative solutions. Via our newsletter, you can keep yourself up to date on all of this coolness. Subscribing only takes seconds.