Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 using only half of logical cores

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT8 using only half of logical cores

    Hello,

    While running the strategy optimizer I noticed that NT8 is only using half of the logical cores. Also, the trace file shows that it is detecting half of the real number of cores (36 instead of 72).

    I suppose it is asking the OS for the number of physical cores instead of the logical ones. As a result, during a strategy optimization, half the cores will sit there with a 0% utilization level and the other half at 100%.

    Is there some way to force NT8 to use all logical cores? Just in case, I checked the config.xml file and I didn’t find any mention of the words “processor”, “cores”, “threads” or “worker”.
    Additionally, I tried adding a “NumberOfWorkerThreads” key but it didn’t have any effect.

    #2
    Hello Merkor,

    Thanks for your post.

    What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)​​

    NinjaTrader 8 is multi-threaded and uses dispatcher thread pool control. From there, the windows operating system designates which logical processor (CPU core) any thread will be run on and the operating system will handle load balancing.

    NinjaTrader will use all of the processors when designating new threads (limited to a maximum of 63). Some processes will occur on the same thread, and it is not possible to split these between processors. As an example, a single backtest would be a single thread and would be performed on a single processor.

    Please see this forum thread for detailed information about how NinjaTrader uses cores: https://forum.ninjatrader.com/forum/...11#post1129011

    That said, ​the way that applications interact with your CPU is completely determined by your operating system. There would not be a way to force NinjaTrader to use a certain number of cores or CPU.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello, Brandon,

      Thank you very much for your reply.
      Here is the version as copied directly from that window:
      8.1.1.7 64-bit

      Also, I'm attaching a screenshot. Please let me know if you need anything else and I will be happy to provide it.Click image for larger version

Name:	NT8_36threads.png
Views:	256
Size:	125.6 KB
ID:	1278965

      Comment


        #4
        Hello Merkor,

        Thanks for your notes.

        Processors with over 64 cores will not utilize all cores in optimizations.

        We note in the System Requirements page of the Help Guide that 64 cores would be a limit. This is because NinjaTrader is not a "processor group aware" application.​

        This publicly available resource could be viewed for more information on processor groups - https://bitsum.com/general/the-64-co...s-and-windows/

        The processor grouping is determined by your operating system. There is no workaround for forcing NinjaTrader to use all cores in optimizations.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hello, Brandon,

          Thank you for your reply.
          Shouldn't NinjaTrader at least use the 64 cores that you mention? Right now it is only seeing and using 36 cores.

          Anyway, if I reduce to 64 the number of cores available to the OS, will then NinjaTrader use 64 of them instead of only half?

          Comment


            #6
            Hello Merkor,

            Thanks for your notes.

            NinjaTrader could use up to 64 cores as that would be the limit noted in the System Requirements help guide documentation.

            However, since the processor grouping is determined by your operating system and NinjaTrader is not a "processor group aware" application, there would be no workaround to force NinjaTrader to use all cores.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Hello, Brandon,

              Either I'm not understanding your reply or there is some confusion in my/your wording.

              Once again, NinjaTrader is only seeing 36 cores. From your last reply it seems that you indicate that it should see up to 64.
              However, that is not happening at all. The trace log file shows NinjaTrader only seeing 36 cores.

              Please advise.

              Comment


                #8
                Hello Merkor,

                Thanks for your notes.

                To clarify, are you using a virtual / cloud server with NinjaTrader?

                From the help guide linked below:

                " Using a virtual / cloud server

                If you are using a virtual or cloud server as basis for your setup when running optimization testing in the Strategy Analyzer, please keep in mind that such environments can typically allocate available resources on demand. NinjaTrader will still take advantage of all available threads for it's processing, however those resources available would be determined at the start-up of the NinjaTrader platform. So if your virtual resources would have changed while you were in a working session, then please restart fresh to ensure performance will be optimal."


                https://ninjatrader.com/support/help...ionPerformance
                <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                Comment


                  #9
                  Hello,

                  No. This is a physical computer sitting right in front of me and not a virtual or cloud server.
                  Windows is running on top of the hardware with no emulation or virtualization in between.
                  NT8 is running on Windows with nothing (sandbox or anything similar) between the two.

                  Comment


                    #10
                    Hello Merkor,

                    Thanks for your notes.

                    The Windows Operating System has grouped 36 processors and the other 36 processors.

                    Ninjatrader only has access to 1 of the processor groups so only 36 cores are detected for NinjaTrader to use.

                    There would be no means for forcing NinjaTrader to use both processor groups to use all cores.
                    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                    Comment


                      #11
                      Hello, Brandon,

                      Thank you for your clarification. I will try to find a workaround either by telling Windows to limit cores to 64 or limiting them through the BIOS.
                      I will update later on the result of this.

                      Comment


                        #12
                        How many iterations does your optimization produce?

                        Comment


                          #13
                          Hello, Brandon,

                          Just to report back in case any other user runs into the same issue.
                          After limiting through the bios the number of physical cores to 16 (32 in total), NT8 is now able to see and use 64 logical cores.

                          Allegedly the 64 cores limitation has been removed in Windows 11, due to it removing the grouping of processors. I will test that later on.

                          Comment


                            #14
                            Originally posted by spottysallrite View Post
                            How many iterations does your optimization produce?
                            Hello,

                            This depends on how many different optimization options you choose, so it varies wildly depending on what I am trying to optimize.

                            For example, let's say that you are testing different options for 1 single SMA, going from 100 to 500 and with steps of 10. That's 40 iterations.

                            If you add another SMA with the same granularity, then the number of iterations jumps to 1600.

                            If you add an option for RSI below or above 50, then that doubles the previous number and now it is 3200 iterations.

                            If now you add another SMA like the ones before, you suddenly have 128000 iterations.
                            Last edited by Merkor; 11-23-2023, 11:22 AM.

                            Comment


                              #15
                              Right, that's because of the permutations of those variables. I often run optimizatons with a few hundred permutations, and typically do that on my laptop, which has 16 cores. When there are more permutations than cores, the cores are entirely used. When the number of permutations because less (eg, as the optimizer works thru the perms), the number of cores used is the same number of remaining perms. In the past I used virtual machines on Google Cloud to increase the number of cores (and RAM). I've gotten to as many as 42 cores, and they are all used as I've described here.

                              In short, I haven't run into any issues with NT's optimizer regarding using all of the available cores -- they are all used as needed, typically producing 100% utilization of all of them.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              20 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              119 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              63 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              41 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              45 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X