I'm rather confused... I see post after post that the minecraft server is not multithreaded, but cannot figure out how people are running 100+ slot servers - even an i7 with a single thread could potentially only run 40-50 players until hitting the cap on one core, even overclocked. Also, posts like this aid in the confusion: viewtopic.php?f=1014&t=55433
(says 8-core scalable Opterons)
As it is, I have a stock-speed X2 7750 @ 2.7ghz that reaches its cap (50% usage) around 20 players.
So what gives? Have these larger servers just figured out a way to multithread the server application? Or is that one server wasting 7 cores? :smile.gif:
Yes, there are at least two threads running. I have seen the server throw an exception, yet keep running - but the level autosave stops working. >:sad.gif:
Looking at the source, it seems that the server implements Runnable and uses that to instantiate a separate thread. No other classes implement Runnable. The server thread is probably monolithic, handling 99% of things in a single thread. It is unlikely that it would benefit from having access to multiple cores, although that is generally a good thing as the OS can handle its business on one core and the Minecraft server can use the other.
If the server seems to be running very fast, consider that Java uses JIT technology to compile the code to machine-native. It is not quite as fast as C++, since Java is doing things like garbage collection, but it is still nice and quick.
So it has two threads then, but one thread barely runs anything?
Something else I just remembered.... when downloading the minecraft_server.exe from minecraft.net, and running it, under stats it shows "Threads: 0 + 0". When I first started running a server, I ran this default GUI interface. With 10 people on the server, I remember it showing "Threads: 3 + 3". This just makes me more confused...
@ Recursion, as long as an application is multithreaded, it can run on multiple cores, as many cores as there are threads. It may not be efficient (i.e. one thread may only require 2% core usage, and the other might require 100% core usage, so the net result would be 51% of a dual core CPU being used), but it will still distribute threads among the cores as efficiently as possible.
I had to post on this because it makes me sad how ignorant most people are on the subject of multi-threaded apps - and the entire idea surrounding hyper-threading (2 different topics)
First of all, your 980X does NOT have 12 cores. it has 6 it uses hyper-threading to give it the possibility of running a second thread simultaneously through a single core, using resources not in use by the first thread. UNDER BEST CASE SCENARIO this will result in a 20% speedup. Oddly enough, for the purposes of mindcraft (and almost every other game currently on the market) you will get BETTER performance by disabling hyper-threading (and overclocking). This is what I have done to my i7-930.
On a side note, this is the whole premise of the Bulldozer concept that AMD is going for, they will have 2 strong threads per core, hopefully giving them a 60-80% boost in core productivity. If that fails, then AMD will take a huge blow. As it is, Intel has the edge clock for clock, and since almost all gaming is done on a few massive threads, faster clockspeeds on the most efficent core architecture will give you the best performance. A fun experiment would be to turn off 2 cores, HT and overclock a i7-960 to 4.4ghz+ (probably a lot more on liquid). I bet it would be able to support more than any other setup currently. This is because of the way threading works.
Ideally, the SMP server would use several threads for different tasks, the more threads you can break everything up into, the better you can distribute the load across multiple cores (and infact, multiple computers, which would be how you would get an MMO setup using minecraft - could be very cool someday - think 2,000 minecrafters in clan wars, riding their trusted... pigs? into battle) Minecraft does almost everything in a single thread, which fails to take advantage of the vast majority of the resources available.
TLDR - Hyperthreading sucks except for HIGHLY threaded applications (and still not that awesome, overclocking is usually > then hyperthreading on). SMP server will run best at fastest clock speed you can get on 2-3 cores (2 for SMP server, +1 for OS?) RAM will help a ton.
viewtopic.php?f=1014&t=55433
(says 8-core scalable Opterons)
As it is, I have a stock-speed X2 7750 @ 2.7ghz that reaches its cap (50% usage) around 20 players.
So what gives? Have these larger servers just figured out a way to multithread the server application? Or is that one server wasting 7 cores? :smile.gif:
Looking at the source, it seems that the server implements Runnable and uses that to instantiate a separate thread. No other classes implement Runnable. The server thread is probably monolithic, handling 99% of things in a single thread. It is unlikely that it would benefit from having access to multiple cores, although that is generally a good thing as the OS can handle its business on one core and the Minecraft server can use the other.
If the server seems to be running very fast, consider that Java uses JIT technology to compile the code to machine-native. It is not quite as fast as C++, since Java is doing things like garbage collection, but it is still nice and quick.
Multicored No.
Something else I just remembered.... when downloading the minecraft_server.exe from minecraft.net, and running it, under stats it shows "Threads: 0 + 0". When I first started running a server, I ran this default GUI interface. With 10 people on the server, I remember it showing "Threads: 3 + 3". This just makes me more confused...
@ Recursion, as long as an application is multithreaded, it can run on multiple cores, as many cores as there are threads. It may not be efficient (i.e. one thread may only require 2% core usage, and the other might require 100% core usage, so the net result would be 51% of a dual core CPU being used), but it will still distribute threads among the cores as efficiently as possible.
Ones a reader thread
Ones a sender thread (using a stack)
However thats irrelevant, because most of the big work isn't done by those threads.
And considering how the work jumps around 100% of a core on my quad core sometimes, it isn't threaded well to be running on a multi core system.
Yes, I have a 980X.
Check out my Let's Play Series:
What purpose did you build your machine for?
First of all, your 980X does NOT have 12 cores. it has 6 it uses hyper-threading to give it the possibility of running a second thread simultaneously through a single core, using resources not in use by the first thread. UNDER BEST CASE SCENARIO this will result in a 20% speedup. Oddly enough, for the purposes of mindcraft (and almost every other game currently on the market) you will get BETTER performance by disabling hyper-threading (and overclocking). This is what I have done to my i7-930.
On a side note, this is the whole premise of the Bulldozer concept that AMD is going for, they will have 2 strong threads per core, hopefully giving them a 60-80% boost in core productivity. If that fails, then AMD will take a huge blow. As it is, Intel has the edge clock for clock, and since almost all gaming is done on a few massive threads, faster clockspeeds on the most efficent core architecture will give you the best performance. A fun experiment would be to turn off 2 cores, HT and overclock a i7-960 to 4.4ghz+ (probably a lot more on liquid). I bet it would be able to support more than any other setup currently. This is because of the way threading works.
Ideally, the SMP server would use several threads for different tasks, the more threads you can break everything up into, the better you can distribute the load across multiple cores (and infact, multiple computers, which would be how you would get an MMO setup using minecraft - could be very cool someday - think 2,000 minecrafters in clan wars, riding their trusted... pigs? into battle) Minecraft does almost everything in a single thread, which fails to take advantage of the vast majority of the resources available.
TLDR - Hyperthreading sucks except for HIGHLY threaded applications (and still not that awesome, overclocking is usually > then hyperthreading on). SMP server will run best at fastest clock speed you can get on 2-3 cores (2 for SMP server, +1 for OS?) RAM will help a ton.