{"id":87,"date":"2009-05-22T00:32:24","date_gmt":"2009-05-22T05:32:24","guid":{"rendered":"http:\/\/24.183.55.167:8101\/wordpress\/?p=87"},"modified":"2012-08-14T20:55:20","modified_gmt":"2012-08-15T01:55:20","slug":"performance-benchmark-freebsd-vs-ubuntu-vs-os-x-which-one-is-better","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/performance-benchmark-freebsd-vs-ubuntu-vs-os-x-which-one-is-better\/","title":{"rendered":"Performance Benchmark: FreeBSD vs Ubuntu vs OS X, which one is better?"},"content":{"rendered":"<p>If you cannot decide whether you should go with FreeBSD or Ubuntu (or Linux), check out this article: <a href=\"\/wordpress\/freebsd-or-linux\/\" title=\"FreeBSD or Linux in 6 Simple Questions\" target=\"_blank\"><strong>FreeBSD or Linux in 6 Simple Questions<\/strong><\/a><\/p>\n<p>Recently I am working on building a web farm which is formed by three ancient time computers (The sum of their ages is older than me). Therefore, I need to pick an operating system to make them running efficient enough. Basically here are my criterias:<\/p>\n<ul>\n<li>It must be secure. (Sorry, Microsoft Windows, I tried installing Windows Server and the OS got infected by virus in 20 minutes after connecting to Web.)<\/li>\n<li>It must be stable and require no reboot. (I have a very good experience with FreeBSD. My longest record of uptime is 6 months so far.)<\/li>\n<li>It must be efficient and effective on performance.<\/li>\n<\/ul>\n<p><\/p>\n<p>So after trying different operating systems, I ran down to three choices: FreeBSD 8, Ubuntu 10 and OS X.<\/p>\n<p>And I finally go with <strong>FreeBSD 8<\/strong>. Before I talked about why I kick the Ubuntu and OS X away, let me discuss what methodology I used.<\/p>\n<h3><strong>First Test: Extreme Computation<\/strong><\/h3>\n<p>I write a program to calculate the value of pi using Monte-Carlo simulations. For those who are not familiar with this simulation method, basically it try to repeat a calculation for n times and try to determine the value of pi based on the results of calculations. This calculation will use all available CPU resources.<\/p>\n<p>Here is the result from a computer: Pentium II 400MHz + 160MB<\/p>\n<ul>\n<li>FreeBSD 8.1 ~ 5 seconds<\/li>\n<li>FreeBSD 4.11~ 10 seconds<\/li>\n<li>Ubuntu 10.04 ~ 8 seconds<\/li>\n<li>OS X 10.3.9 ~ 11 seconds<\/li>\n<\/ul>\n<p><\/p>\n<p>The result is very obvious, FreeBSD 8.1 is the best candidate in this test. However, the result of my program only gives a very small portion of the picture. So I decide to run another test:<\/p>\n<h3><strong>Second Test: Apache Benchmark<\/strong><\/h3>\n<p>No test is better than the real world test drive. Since my primary purpose is for web server, so I decide to test the performance on how Apache perform on different operating systems. My test is pretty simple, I basically ask the Apache Benchmark client to download a page from the test server. The page does three things:<\/p>\n<ol>\n<li>Display a picture<\/li>\n<li>Insert a record into MySQL database<\/li>\n<li>Retrieve the current count from MySQL database<\/li>\n<\/ol>\n<p><\/p>\n<p>This way I can test the overall performance on how the system handles the file I\/O, database I\/O and computations.<\/p>\n<p>So the result is pretty interesting (1000 total requests and 100 concurrent requests)<\/p>\n<ul>\n<li>FreeBSD 8.1 ~ 200 requests\/sec, no failure<\/li>\n<li>FreeBSD 4.11~ 150 requests\/sec, approx. 20% failure.<\/li>\n<li>Ubuntu 10.04 ~ 180 requests\/sec, no failure<\/li>\n<li>OS X 10.3.9 ~ 160 requests\/sec, approx. 50% failure.<\/li>\n<\/ul>\n<p><\/p>\n<p>I am not surprised with the result because FreeBSD 8 really does a very good job in kernel optimization. Since kernel is the heart(or brain) of all computations, an OS with good kernel is expected to give good results always.<\/p>\n<p>So, I finally pick FreeBSD 8 as the core OS of my web farm, and I am loving it.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you cannot decide whether you should go with FreeBSD or Ubuntu (or Linux), check out this article: FreeBSD or Linux in 6 Simple Questions Recently I am working on <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/performance-benchmark-freebsd-vs-ubuntu-vs-os-x-which-one-is-better\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[7,144,6],"tags":[20,171,12,19,18],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-sever-problem","category-technology","tag-benchmark","tag-freebsd","tag-os-x","tag-performance","tag-ubuntu"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-1p","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":923,"url":"https:\/\/icesquare.com\/wordpress\/freebsd-or-linux\/","url_meta":{"origin":87,"position":0},"title":"FreeBSD or Linux in 6 Simple Questions","author":"Derrick","date":"February 18, 2016","format":false,"excerpt":"FreeBSD or Linux FreeBSD or Linux (Ubuntu\/RHEL)? This is a very old question. It's like asking iPhone or Android. There is no short answer. It all depends on your situation. To make things easier, I am going to break it down into six simple questions to help you making decision.\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1927,"url":"https:\/\/icesquare.com\/wordpress\/phphow-to-get-the-number-of-cpu-cores-in-fedora-ubuntu-and-freebsd\/","url_meta":{"origin":87,"position":1},"title":"[PHP]How to get the number of CPU cores in Fedora, Ubuntu, and FreeBSD","author":"Derrick","date":"December 2, 2011","format":false,"excerpt":"I am working on a PHP application which needs to be deploy to multiple places. One of the variables is the number of CPU core. Since each server has different number of CPU cores, I need to specify the number of CPU core in my application for each server. I\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":917,"url":"https:\/\/icesquare.com\/wordpress\/what-can-you-do-with-a8m2n-la-nodusm-gl8e\/","url_meta":{"origin":87,"position":2},"title":"What can you do with A8M2N-LA \/ NodusM-GL8E?","author":"Derrick","date":"October 30, 2010","format":false,"excerpt":"Recently, I decided to turn my HP m7557c computer (motherboard: A8M2N-LA \/ NodusM-GL8E) to an Unix server. The nightmare began. After trying nearly 10 different operating systems and distributions, I found that only very few of them worked with A8M2N-LA \/ NodusM-GL8E. I think it is worth to share my\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":237,"url":"https:\/\/icesquare.com\/wordpress\/does-most-popular-imply-the-best\/","url_meta":{"origin":87,"position":3},"title":"Does the most popular imply the best?","author":"Derrick","date":"August 19, 2009","format":false,"excerpt":"Today, I had a discussion with my co-worker on the best languages for web applications. While I argued that Perl, and Ruby performs better than PHP, my co-worker had an opposite opinion. He believed that PHP is the best language overall because it is widely used. It brings me to\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1511,"url":"https:\/\/icesquare.com\/wordpress\/how-to-clean-up-the-dmesg-message\/","url_meta":{"origin":87,"position":4},"title":"How to clean up the dmesg message","author":"Derrick","date":"August 24, 2011","format":false,"excerpt":"Recently, I found that my dmesg log are filled of junk. Or I should say it contains lots of errors and complains that I already fix. However, I don't want to reboot the machine to get rid of these error messages. How can I do it? The solution is very\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1521,"url":"https:\/\/icesquare.com\/wordpress\/what-os-is-good-for-sparc64\/","url_meta":{"origin":87,"position":5},"title":"What OS is good for SPARC64?","author":"Derrick","date":"September 13, 2011","format":false,"excerpt":"Recently, I received a SPARC64 machine (Sun Blade 100) as a gift. If you are not sure what is SPARC64, it is a CPU primary manufactured by Sun\/Oracle. It is quite different than Intel x86 \/ AMD 64, so anything that is compiled to run on these two platforms will\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/09\/sparc.jpg","width":350,"height":200},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":30,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":2947,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/87\/revisions\/2947"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}