Skip to main content
Inspiring
May 4, 2023
Answered

Limit the number of cores ColdFusion uses?

  • May 4, 2023
  • 1 reply
  • 1290 views

Hi,

 

I have a question regarding licensing/cores.

 

Say, for whatever reason, ColdFusion 2021 was installed on an 8 core VM, but is only licensed for 4 cores (2 x Standard licenses). Is it possible to limit the number of cores CF uses by some mechanism other than reducing the number of cores the VM has? I'm thinking Java startup parameters, or something similar. Or is the only way to get CF to use four cores by reducing the VM core count to 4?

 

Many thanks!

Mike.

This topic has been closed for replies.
Correct answer Dave Watts

I don't think that ActiveProcessorCount JVM parameter is going to prevent the JVM from using all of the cores. Instead, use "affinity" on Windows, or cgroup or a similar thing on Linux.

 

Dave Watts, Eidolon LLC

1 reply

Charlie Arehart
Community Expert
Community Expert
May 4, 2023

I'll say that I'm not aware of any such jvm or cf config option, so that limiting the VM (or machine) core number would be the only solution. 

/Charlie (troubleshooter, carehart. org)
TheRealMCAuthor
Inspiring
May 4, 2023

Thanks for the response, Charlie. I certainly couldn't find anything CF-specific either.

 

Since posting, I have found mention of a JVM parameter:

-XX:ActiveProcessorCount=n

where 'n' is the number of processors required. This sounded promising, but apparently it may only limit the number of threads generated, rather than actually limit CPU usage. I need to do some more reading around that.

 

I also found information on setting the process affinity on the executable (so limiting at the OS level), which sounds promising. Again, I need to research this more.

 

In the meantime, if anyone has any experience with either of the two approaches above, I'd be very grateful if you could share!

 

Many thanks!

Mike.

Dave WattsCommunity ExpertCorrect answer
Community Expert
May 5, 2023

I don't think that ActiveProcessorCount JVM parameter is going to prevent the JVM from using all of the cores. Instead, use "affinity" on Windows, or cgroup or a similar thing on Linux.

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC