Page MenuHomePhabricator

Investigate using Mutagen to boost performance
Closed, DeclinedPublic

Description

People have used mutagen to successfully get close to native Linux performance on macOS. Of course, there are a lot of caveats, for example the Docker team decided not to include it in Docker for Mac (https://github.com/docker/roadmap/issues/7#issuecomment-705416084), but maybe it would work for our purposes.

In trying to set it up, I was blocked with our user/group setup with Apache/PHP-FPM. I couldn't specify a user to sync with because our image doesn't have one.

Event Timeline

kostajh added a subscriber: Addshore.

@Addshore the ddev project recently added mutagen support (https://github.com/drud/ddev/search?q=mutagen), maybe that's something that could be done in mwcli too. (Not suggesting that you do it of course, just bringing it to your attention in case you're interested.)

Sounds interesting.
For syncing the files the user running the dev setup should be used in order to keep the file permissions correct.
Does mutagen not allow that?

Sounds interesting.
For syncing the files the user running the dev setup should be used in order to keep the file permissions correct.
Does mutagen not allow that?

It does, I think the issue is that the dev image doesn't have a user (same underlying problem as T248802); or at least it didn't the last time I looked at this, I haven't checked since.

It indeed still does not, it only uses the nobody user for running services like apache or php-fpm.
T293551: [mwcli] PHP Notice: Writing to /.config/psysh is not allowed was actually fixed for mwcli in the latest release.
The exec commands though (and docker in general) allows you to run things in the container as "the correct user" or rather as a non existant user but using the correct uid and gid, which I assume is what mutagen needs to do if it is copying files around?

Per https://mutagen.io/documentation/synchronization/permissions

Owner and group specifications can be provided in three different formats:

POSIX-ID-based: A string of the form id:N, where N is a number representing the user or group ID. This is only supported for POSIX endpoints.

I imagine passing in your host uid and gid might make it all work?
And if so I imagine making this all work as part of mwcli should be easy enough?

I tried an alternative approach without using the beta mutagen, but not greatly successful initially
https://gitlab.wikimedia.org/releng/cli/-/commit/71ed4c256914b1d5ffc0c113962abdcea667264d

Addshore moved this task from In Progress to Backlog on the mwcli board.

Tip: There is now a Mutagen extension for Docker Desktop available that provides automatic replacement of bind mounts with Mutagen-synchronized filesystem caches, offering the same performance benefits of Mutagen Compose without the need for an alternative Compose implementation.

So I think we can close this?