[2010 네이트 앱스토어 개발자 세미나] 앱스 제작 사례 (2) 소셜게임 서버 구성 전략

Embed Size (px)

DESCRIPTION

[2010 네이트 앱스토어 개발자 세미나] 세션3-2 앱스 제작 사례 (2) 소셜게임 서버 구성 전략 선데이토즈 임현수 CTO

Citation preview

2. Daily Active User 3. ~ ~ 4. .... 5. / PHP, Java, Ruby On Rails, Memcached... LAMP(Linux, Apache, MySQL, PHP), Resin, Tomcat, Nginx... HTTP Call , Gzip, Expire .. 6. (Write, Delete, Update) . . .(swf, img) . (Update) . 7. , // 8. , .Web Server ab, http_load, JMeterMysql MySQL Benchmark Suite, mysqlslap, Database Test Suite, mysqlreport, Tuning Primer..OS sar, iostat, vmstat.. 9. ~ DB 10. DB DB - DB Call / / 11. - Scale Up 12. - Scale Out 13. - Scale UpScale Up = Scale Up Scale Up DB DB < 14. - Scale Up IO IO SAS, SSD, FusionIO ... Table Partioning, RAID 15. - Scale Out ? Scale Out DB DB 16. Database Scale Out Slave R eplication : http://knowledgehub.zeus.com/media/mysql1.png 17. Database Scale Out Sharding : http://www.dbshards.com/wp-content/uploads/2010/06/dbsDiagram2.png 18. Web Server(s) Shardingusersusers users users1-100 101-200 201-300 301-400user_farms user_farmsuser_farmsuser_farms1-100 101-200 201-300 301-400user_crops user_cropsuser_cropsuser_crops1-100 101-200 201-300 301-400user_items user_itemsuser_itemsuser_items1-100 101-200 201-300 301-400DB 1 DB 2 DB 3 DB 4 19. Database Scale Out ShardingDB DB Join, Transaction Hash , 20. Web Server(s) Shardingusersusers users user_friends1-100 101-200 201-300user_farms user_farmsuser_farmslog_payment1-100 101-200 201-300user_crops user_cropsuser_cropsfarm_schema1-100 101-200 201-300user_items user_itemsuser_items1-100 101-200 201-300DB 1 DB 2 DB 3 DB 4 21. MySQL - my.cnfPHP : php.iniApache : httpd.confnginx : nginx.confResin : resin.conf 22. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .... 23. PHP op-code caches : APC, XCache, eAccelerator..Memcached NoSQL 24. Nginx, Lighttpd 25. Nginx vs Apache 26. Memcached DB Call 1 . : 27. NoSQL 28. NoSQLredis, cassandra, mongoDB, tokyo-cabinet/tyrant,cauchDB .... , , MySQL 29. apache / nginx mod_php / php-fpm /resin / tomcat memcachedNoSQL (redis, mongodb) 30. apache / nginx mod_php / php-fpm /resin / tomcat memcachedNoSQL (redis, mongodb) MySQL 31. apache / nginx mod_php / php-fpm /resin / tomcatNoSQL (redis,memcached mongodb) MySQL 32. / , , . , , SMS 33. / nagios, catci, collectd awstat mrtg M/Monit, god 34. (Fail Over) , , , . , Monit . 35. (Fail Over) DNS ... 36. Monit Examplecheck system localhost if loadavg (1min) > 4 then alertcheck process apache with pidle /usr/local/apache/logs/httpd.pid if loadavg (5min) > 2 then alertstart program = "/etc/init.d/httpd start" with timeout 60 seconds if memory usage > 75% then alertstop program = "/etc/init.d/httpd stop" if cpu usage (user) > 70% then alertif cpu > 60% for 2 cycles then alert if cpu > 80% for 5 cycles then restart if cpu usage (system) > 30% then alert if totalmem > 200.0 MB for 5 cycles then restart if cpu usage (wait) > 20% then alertif children > 250 then restart if loadavg(5min) greater than 10 for 8 cycles then stop if failed host www.tildeslash.com port 80 protocol http and request "/somele.html" then restart if failed port 443 type tcpssl protocol http with timeout 15 seconds then restart if 3 restarts within 5 cycles then timeout depends on apache_bin group server 37. / / revision export rollback Capistrano 38. , DB & DB I/O DB Call DB I/O Memcached, NoSQL 39. , 40. 41.