No more mysteries: Apple's G5 versus x86, Mac OS X versus Linux
by Johan De Gelas on June 3, 2005 7:48 AM EST- Posted in
- Mac
Mac OS X versus Linux
Lmbench 2.04 provides a suite of micro benchmarks that measure the bottlenecks at the Unix operating system and CPU level. This makes it very suitable for testing the theory that Mac OS X might be the culprit for the terrible server performance of the Apple platform.Signals allow processes (and thus threads) to interrupt other processes. In a database system such as MySQL 4.x where so many processes/threads (60 in our MySQL screenshot) and many accesses to the kernel must be managed, signal handling is a critical performance factor.
Larry McVoy (SGI) and Carl Staelin (HP):
" Lmbench measure both signal installation and signal dispatching in two separate loops, within the context of one process. It measures signal handling by installing a signal handler and then repeatedly sending itself the signal."
Host | OS | Mhz | null | null call |
open I/O |
stat | slct clos |
sig TCP |
sig inst |
Xeon 3.06 GHz | Linux 2.4 | 3056 | 0.42 | 0.63 | 4.47 | 5.58 | 18.2 | 0.68 | 2.33 |
G5 2.7 GHz | Darwin 8.1 | 2700 | 1.13 | 1.91 | 4.64 | 8.60 | 21.9 | 1.67 | 6.20 |
Xeon 3.6 GHz | Linux 2.6 | 3585 | 0.19 | 0.25 | 2.30 | 2.88 | 9.00 | 0.28 | 2.70 |
Opteron 850 | Linux 2.6 | 2404 | 0.08 | 0.17 | 2.11 | 2.69 | 12.4 | 0.17 | 1.14 |
All numbers are expressed in microseconds, lower is thus better. First of all, you can see that kernel 2.6 is in most cases a lot more efficient. Secondly, although this is not the most accurate benchmark, the message is clear: the foundation of Mac OS X server, Darwin handles the signals the slowest. In some cases, Darwin is even several times slower.
As we increase the level of concurrency in our database test, many threads must be created. The Unix process/thread creation is called "forking" as a copy of the calling process is made.
lmbench "fork" measures simple process creation by creating a process and immediately exiting the child process. The parent process waits for the child process to exit. The benchmark is intended to measure the overhead for creating a new thread of control, so it includes the fork and the exit time.
lmbench "exec" measures the time to create a completely new process, while " sh" measures to start a new process and run a little program via /bin/ sh (complicated new process creation).
Host | OS | Mhz | fork hndl |
exec proc |
Sh proc |
Xeon 3.06 GHz | Linux | 3056 | 163 | 544 | 3021 |
G5 2.7 GHz | Darwin | 2700 | 659 | 2308 | 4960 |
Xeon 3.6 GHz | Linux | 3585 | 158 | 467 | 2688 |
Opteron 850 | Linux | 2404 | 125 | 471 | 2393 |
Mac OS X is incredibly slow, between 2 and 5(!) times slower, in creating new threads, as it doesn't use kernel threads, and has to go through extra layers (wrappers). No need to continue our search: the G5 might not be the fastest integer CPU on earth - its database performance is completely crippled by an asthmatic operating system that needs up to 5 times more time to handle and create threads.
116 Comments
View All Comments
tfranzese - Friday, June 3, 2005 - link
Kind of snappy there Johan.I do prefer numbers coming from one source myself.
JohanAnandtech - Friday, June 3, 2005 - link
Rubikcube: Speculative? Firstly, Both a webserver and a database server show terrible performance. Secondly, LMbench shows there is definitely a problem with creating threads. So everything point into our "speculative" conclusion.Thirdly, as mentioned in an earlier post:
http://www-106.ibm.com/developerworks/linux/librar...
is another indication that there is nothing speculative about our conclusion.
rubikcube - Friday, June 3, 2005 - link
#21 I disagree. Most of the end of the article on the threading problems was speculative. We can't say that's the cause without actual testing.Jalf - Friday, June 3, 2005 - link
To those wanting a Linux on G5 test, keep in mind the entire purpose of this article. It was to test the performance of a Mac computer running a Mac OS, compared to a Intel/AMD PC.So while installing Linux on the G5 would give us a better idea of how the CPU itself performs, it would also leave out the huge effect the OS also has (You wouldn't have seen the huge performance problems with threading, for example.)
Jalf - Friday, June 3, 2005 - link
#11: Not true, if you browse AMD's documentation for a bit, they do say that their TDP *is* the absolute max power.Intel uses the "maximum power achievable under most circumstances"-method though.
rubikcube - Friday, June 3, 2005 - link
I agree that linux should have been used for a more normalized comparison. I also think that you should have tried running your mysql tests from darwin on x86. You might have been able to find the cause of the performance anomalies.Sabresiberian - Friday, June 3, 2005 - link
I find it hilarious that someone calling him- or herself 'porkster' is complaining about someone else's language :)Apple's computers have made their fame on their user-friendliness, so I think it is very appropriate to compare these computers with OSX on the Apples, as that's where the user-friendliness resides and both OSes are in the same family. It would have been fun to compare using the 64 bit Win XP Pro - I bet we would all get a good laugh out of that. Microsoft is determined, I think, to make a Linux man out of me yet :)
kresek - Friday, June 3, 2005 - link
waiting for AnandTech's YDL results, have a look at this:http://www-106.ibm.com/developerworks/library/l-yd...
SMOG - Friday, June 3, 2005 - link
#13 Thresher: "When it comes down to it, performance is important, but not the only reason people buy what they buy. I would say more often than not, the decision is made with only a modicum of logic."Your right, and those people didn't read this article, at best they read the first page then skipped to the last to see if he bashed Apple or not. This article was for those who want to know just what the power of the PowerPC actually is. This is a technical artical, not a buyers guide. This is science.
Good Job.
CU - Friday, June 3, 2005 - link
You mentioned most people don't use the Intel compiler, but it would have been nice to see it and also the windows compiler and the ibm compiler.