# Windows or Mac and GOMAXPROCS

**URL:** https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992
**Category:** Support
**Created:** [November 23, 2017, 7:57am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992 "2017-11-23T07:57:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Samuel\_Bruyere](https://forum.syncthing.net/user_avatar/forum.syncthing.net/samuel_bruyere/32/4277_2.png) [@Samuel\_Bruyere](https://forum.syncthing.net/u/Samuel_Bruyere)
#### Post date: [November 23, 2017, 7:57am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992/1 "2017-11-23T07:57:08Z")

</div>

Hi, I’ve see the option GOMAXPROCS but can’t understand how it works on mac and windows.

Thanks. Sam

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 23, 2017, 8:04am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992/2 "2017-11-23T08:04:48Z")

</div>

It works the same everywhere, setting the maximum number of CPU threads that will be used for CPU bound work.

---

<div class="post-metadata">

### Author: ![Samuel\_Bruyere](https://forum.syncthing.net/user_avatar/forum.syncthing.net/samuel_bruyere/32/4277_2.png) [@Samuel\_Bruyere](https://forum.syncthing.net/u/Samuel_Bruyere)
#### Post date: [November 23, 2017, 8:26am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992/3 "2017-11-23T08:26:11Z")

</div>

Sorry, I don’t understand how it work.

On Windows I’ve create this comand line

SET GOMAXPROCS=1 syncthing -no-browser -home=%~dp0data\syncthing

On my system all Uc seems to be used. No traces of GOMAXPROCS in the log ☹

Tks. Sam

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 23, 2017, 8:31am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992/4 "2017-11-23T08:31:25Z")

</div>

That probably depends on what the command line is fed to. Environment variables are complicated in Windows.

[http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-command-line-and-registry/](http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-command-line-and-registry/)

Simplest, I think, for testing would be to do it in a command prompt as two separate commands.

```
C:\> SET GOMAXPROCS=1
C:\> syncthing -no-browser -home=%~dp0data\syncthing

```

On Mac, similarly, but one command will suffice:

```
$ GOMAXPROCS=1 syncthing ...

```

If you’re using our plist file on Mac you can add a

```
<key>GOMAXPROCS</key>
<string>1</string>

```

in the section that already has other environment variables and then perform the `launchctl unload`, `launchctl load` dance.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [December 23, 2017, 8:45am UTC](https://forum.syncthing.net/t/windows-or-mac-and-gomaxprocs/10992/5 "2017-12-23T08:45:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
