Have minecraft server using a specific CPU core

koyetsu

New Member
Jul 29, 2019
15
0
0
I have seen people talk about this, and i was wondering what the argument for this to occur is?
 

Henry Link

Popular Member
Dec 23, 2012
2,601
553
128
USA - East Coast
I actually don't recommend doing this. But it is set at the OS level and you would look for setting processor affinity. But, with the 64 bit version of java 8 the OS will automatically use the processor cores to its best advantage. The best example of this is my server that is running 3 modded minecraft servers (AGS2, Infinity and a custom) on 8 core CPU. If I watch the CPU I see the usage pretty well balanced. BTW: All three servers have no issues keeping up but you need really good hardware to do this. Mine is xeon 3.4 GHz cpu with 32GB of RAM and two SSD configured for raid 0.
 

koyetsu

New Member
Jul 29, 2019
15
0
0
i apologize for not being precise with this thread. i know how to set cpu affinity under windows however i was looking for how to do this in linux. i have a dual xeon 3.0ghz with 32gb ram and will soon be upgrading to SSD's running ubuntu server. i manage my servers with mineos web interface and was hoping for a java argument that would set a CPU affinity. however if necessary i can run the servers from terminal with screen.
 

Henry Link

Popular Member
Dec 23, 2012
2,601
553
128
USA - East Coast
Looks like you want to use the taskset command for Ubuntu. See this article.

http://manpages.ubuntu.com/manpages/utopic/man1/taskset.1.html

Again, I really don't recommend this. My server at OVH.com is using Ubuntu and I have no problems running three modded minecraft servers on that server without forcing the CPU affinity. I have 8 cores on it and see java using all 8. While the main game thread for minecraft is a single process there are other things that java does involving memory management, garbage collection, etc. that will use the other cores.
 
  • Like
Reactions: lenscas

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
There is no reason to force it to use a specific core(as far as I know), the OS should be smart enough to not put too much things on one core unless it has no other option.
If your OS doesn't do that nicely then either it has no other option or the OS is just bad