JavaEye网站架构解密

1,923 views

Published on

0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,923
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
0
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide

JavaEye网站架构解密

  1. 1. JavaEye Robbin Fan
  2. 2. • JavaEye• JavaEye• JavaEye•
  3. 3. JavaEye
  4. 4. JavaEye• 1U•1 Web Server, 1 DB Server• 2.6• 3
  5. 5. Web Server• AMD Opteron 2.4GHz *2• 8G• 146G SCSI
  6. 6. DB Server• AMD Opteron 2.0GHz *2• 4G• 73G SCSI
  7. 7. 150 /
  8. 8. JavaEye 10 20 RSSRSS 20 100
  9. 9. ruby ......
  10. 10. Google Adplanner Data for JavaEye
  11. 11. Google Adplanner Data for JavaEye
  12. 12. IT CSDN 260 JavaEye 74ChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  13. 13. IT CSDN 260 3.5X JavaEye 74ChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  14. 14. IT CSDN 30+ Server 260 3.5X JavaEye 74ChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  15. 15. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74ChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  16. 16. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 ServerChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  17. 17. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  18. 18. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  19. 19. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server PHP Cnblogs 55 ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  20. 20. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server PHP Cnblogs 55 4+ Server ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  21. 21. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server PHP Cnblogs 55 4+ Server ASP.net ITPUB 38 51CTO 23 infoq 8 0 75 150 225 300
  22. 22. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server PHP Cnblogs 55 4+ Server ASP.net ITPUB 38 PHP 51CTO 23 infoq 8 0 75 150 225 300
  23. 23. IT CSDN 30+ Server ASP.net 260 3.5X JavaEye 74 2 Server rubyChinaUnix 73 4+ Server PHP Cnblogs 55 4+ Server ASP.net ITPUB 38 PHP 51CTO 23 infoq 8 Java 0 75 150 225 300
  24. 24. JavaEye
  25. 25. 2006.09•1••
  26. 26. 2006.09• lighttpd• ruby 1.8.4, rails 1.1.2, fastcgi• mysql5.0
  27. 27. Single Server lighttpdfastcgi(ruby) mysql
  28. 28. 2007.01• 2• web DB• IO
  29. 29. Web Server DB Server lighttpdfastcgi(ruby) mysql
  30. 30. 2007.02• posts• posts select count 30 0.1
  31. 31. posts• posts(id, ..., body)• 2GB
  32. 32. posts• posts(id, post_text_id,...) 50MB• post_texts(id, body) 2GB
  33. 33. 2007.03•• memcached CachedModel•• 240 sql query/s 140 sql query/s• memcached 75%
  34. 34. Web Server DB Server lighttpdfastcgi(ruby) mysqlmemcached
  35. 35. 2007.05••
  36. 36. 2007.09•• ruby ferret•
  37. 37. 2008.01• JavaEye• cache_fu• 84%• sql query 50 /s
  38. 38. 2008.05• rmmseg-cpp
  39. 39. 2008.10• cache plugin• 96%
  40. 40. 2008.10• ferret• Java lucene• C/S
  41. 41. Web Server DB Server lighttpd SearchServer (lucene)fastcgi(ruby) mysqlmemcached
  42. 42. 2008.11• PDF
  43. 43. Web Server DB Server lighttpd SearchServer (lucene)fastcgi(ruby) mysql PDF Creatingmemcached (ruby, C)
  44. 44. 2009.03• SNS feed• twitter• API
  45. 45. Web Server DB Server RSS/API fastcgi(ruby) lighttpd SearchServer (lucene)fastcgi(ruby) mysql PDF Creatingmemcached (ruby, C) twitter sync
  46. 46. 2009.03• Google Analytics•
  47. 47. Web Server DB Server RSS/API fastcgi(ruby) lighttpd SearchServeranalytics (lucene) fastcgi(ruby) mysql PDF Creating memcached (ruby, C) twitter sync DNS Server/Email Server/ NFS Server DNS Server/Email Server
  48. 48. 2009.12• Web IM••
  49. 49. Backgroud ServerWeb Server fastcgi(ruby) IM Server lighttpd PDF Creating SearchServer fastcgi(ruby) DB Server memcached mysql
  50. 50. JavaEye• CachedModel+ QueryCache• cache_fu• cache_plugin• cache_money*
  51. 51. ••• • page cache • frgment cache • REST
  52. 52. •• n• ORM• join n+1 SQL
  53. 53. • Web• IO•• n+1 SQL
  54. 54. CachedModel• , Hibernate•• select * from post_texts where id = ?• 75%
  55. 55. CachedModel• AR find_by_sql••
  56. 56. cache_fu• cache_fu AR•• cache_fu memcached 84%
  57. 57. cache plugin• Rails Cache 60• n:1 1:n• memcached 96%
  58. 58. memcached
  59. 59. memcached
  60. 60. cache_money• twitter• ruby cache•
  61. 61. • JavaEye•• ruby
  62. 62. JavaEye• ruby db Web Server load DB• ruby
  63. 63. ruby• ruby• erb•• ruby
  64. 64. postpost html
  65. 65. postpost html
  66. 66. JavaEye• memcached 96%• cache get : sql query = 4 : 1
  67. 67. JavaEye• ferret• ferret+rmmseg-cpp•
  68. 68. • ferret+rmmseg• ferret
  69. 69. fastcgi json protocol SearchServer (ruby) (java) socketlong lived processes long lived threads
  70. 70. • DNS• Web Server• ruby
  71. 71. Thank you!

×