title: Limit the number of CPU cores used by an Windows service running from net start command
body: <p>I am running an benchmark for PostgreSQL 12 on Windows 10. I want to limit the number of CPU cores used by PostgreSQL service to test how does the CPU performance affect TPU.</p>
  
  <p>Now I am starting PostgreSQL service with following command:</p>
  
  <pre><code> net start postgresql-x64-12
  </code></pre>
  
  <p>and I know how to limit the number of CPU cores for ordinary Windows application like:</p>
  
  <pre><code> start /affinity 1 "" "C:\Windows\System32\calc.exe"
  </code></pre>
  
  <p>How can I limit the number of CPU cores used by an Windows service running from net start command? Is there an <code>/affinity</code> option equivalent in <code>net start</code> command?</p>