ã¯ããã« ãµã¼ããéç¨ãããç°å¢ãæ§ç¯ããããã¦ãã¦ãããããã®ããã»ã¹ã§åãã¦ããã°ã©ãã ã£ãã»ã»ããªã©å°ãã¨ããããã¾ãã ãããªã¨ãã«é ¼ãã«ãªããããããªãã³ãã³ãã 3ã¤ãç´¹ä»ãã¾ãã @madeth 師å ã«æãã¦ããã ãã¾ããã 1. proc ã§ããã»ã¹ã使ã£ã¦ãããã¡ã¤ã«ãè¦ã å°ã£ãã㨠ããã»ã¹ã®åããã°ã®ãã¹ãã©ããã¦ãåãããªãã»ã»ã è§£æ±ºæ³ (ç·¨é 2014/09/10) ç¥ãããããã»ã¹ã® ID ã調ã¹ã¾ãã $ ps aux | grep unicorn deploy 3335 xxx xxx xxx xxx X XX 15:14 0:07 unicorn master -c /var/www/myproject/unicorn/staging.rb -E staging -D ããã»ã¹ID (ãã®å ´å㯠3335) ããã¨ã« root 権éã§ãã¡ã¤ã«ãã£ã¹ã¯ãª
iptablesã§ãµã¼ããå®ãã¨ãã«ç¥ã£ã¦ããã¨è¯ããã¨ã3ã¤ç´¹ä»ãã¾ã 1. æ¥ç¶åæ°ãå¶éãã(IPã¢ãã¬ã¹ãã¨) hash_limitã使ãã¾ã ããã«ããç¹å®ãã¹ãããã®å¤§éã¢ã¯ã»ã¹ãDoSæ»æãç·©åãããã¨ãå¯è½ã§ã ä¾ 2. æ¥ç¶åæ°ãå¶éãã(ãµã¼ãã¹ãã¨) limitã使ã£ã¦å¶éãã¾ã ããã«ããå¤æ°ã®ãã¹ãããã®æ»æãDDoSæ»æãç·©åãã¾ã limitã使ã£ãå¶éã¯å ¨ãã¹ããçããå¶éãåãããããsshçã«è¨å®ãã¹ãã§ã¯ããã¾ããã ï¼æ»æãåãã¦ããéã¯èªåãã¡ãå¶éãããããï¼ Webãµã¼ãã大éã¢ã¯ã»ã¹ã§è½ã¡ãããªå ´åã¯ä½¿ããããããªãã§ããããï¼ ä¾ 3. æ¥ç¶IPã¢ãã¬ã¹ãéå®ãã IPã¢ãã¬ã¹ã®å½å¥å²ãå½ã¦ãAPNICçããåå¾ãã¦ã³ãã³ããä½ãã¾ã ãã®æã®ã«ã¼ã«ã¯é·ããªãã®ã§ãã¦ã¼ã¶ã¼å®ç¾©ãã§ã¤ã³ã«ããã»ããè¦ããããªãã¾ã ä¾ ãã¨ã¯ãããªæãã®ã¹ã¯
nginx(1.3.13)ã§WebSocketã®ãããã·ã試ãã¦ã¿ã¾ãã 2013/2/19ã«nginxãæ£å¼ã«WebSocketã«å¯¾å¿ããã¨ã¢ãã¦ã³ã¹ããã£ãã®ã§ã試ãã«ä½¿ã£ã¦ã¿ã¾ããã ãã¦ã³ãã¼ãã»ã¤ã³ã¹ãã¼ã« ããããnginx-1.3.13ããã¦ã³ãã¼ããã¦ãã¦ãã¤ã³ã¹ãã¼ã«ãã¾ãã ã¤ã³ã¹ãã¼ã«ãªãã·ã§ã³ã¯ããã¦ããã©ã«ã㧠$ wget http://nginx.org/download/nginx-1.3.13.tar.gz $ tar xvf nginx-1.3.13.tar.gz $ cd nginx-1.3.13 $ ./configure $ make $ sudo make install è¨å®ãã¡ã¤ã«ã®æ¸ãæã 次ã«nginx.confãæ¸ãæãã¾ããæ§æ㯠ãªãã¼ã¹ãããã·: 192.168.0.8:80 ããã¯ã¨ã³ããµã¼ã: 192.168.0.2:3000
ãµã¼ãã¼ã®ãªã½ã¼ã¹ãè¦ãã«ã¯ã°ã©ãåã¯éè¦ã§ãããæ¨ç§»ã§ã¯ãªããªã¢ã«ã¿ã¤ã ãªç¶æ³ãä¾ãã°ç§åä½ã®ã¹ãã¤ãã¼ãªè² è·ãè¦ãã«ã¯ããµã¼ãã¼ä¸ã§vmstatãiostatãªã©ã®*statãã¡ããªã¼ãå©ãå¿ è¦ãããã¾ãã ãã¦ãvmstatã¯ã¡ã¢ãªã®ç¶æ³ããããã¯æ°åä½ã®I/Oç¶æ³ã¯è¦ããã¾ããããã¤ãåä½ã®I/Oç¶æ³ããããã¯ã¼ã¯ã®éä¿¡ãåä¿¡ãã¤ãæ°ãè¦ããã¨ã¯ã§ãã¾ããã # vmstat 1 procs -----------memory---------- ---swap--- -----io----- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 3 1 0 4724956 355452 726532 0 0 54 484 3 3 1 0 99 0 0 2 0 0 47
ãµã¼ãç£è¦ã«è¶ 使ãããtopã³ãã³ãã®ã¾ã¨ã ãµã¼ããéç¨ãã¦ããã¨ãã使ãtopã³ãã³ãã§ãããæ¨æºã®top以å¤ã«ãè²ã 便å©ãªãã®ãããã®ã§ã¾ã¨ãã¦ã¿ã¾ããã ããã«ããã¯ã¨ããã°ããããã¯ã¼ã¯ããã£ã¹ã¯IOãã¹ã¯ãããCPUãã¡ã¢ãªã¨ãã£ããã®ãé¢é£ãã¾ããããã¼ã«ã§è¦è¦åãããã¨ã§ããåããããã対çãã¨ãã¾ããã htop ãã¡ãããé常ã®topãããããã«å¤æ°ã®æ å ±ã表示ãã¦ããããã¼ã«ã CPUãã¡ã¢ãªã®ç¶æ ãè¦è¦çã«ã°ã©ãã§è¡¨ç¤ºããã¦ããããè¤æ°CPUãããå ´åãããããã«å©ç¨çã表示ãã¦ããã¦ããããããã§ãã pstreeã§è¡¨ç¤ºãããããªããªã¼+topã³ãã³ãã®ãããªè¡¨ç¤ºã t ãæ¼ãã°åãæ¿ãããã¾ãã å ¬å¼ãµã¤ãä¸ã«ãã128ã³ã¢ç©ãã ãã·ã³ã®htopçµæãé¢ç½ãã 次ã®ããã«ãã¹ã¦ã°ã©ãã§è¡¨ç¤ºããã¦ããããã128ã³ã¢ãã£ãã¨ãã¦ãç¬æã«è² è·ãææ¡ã§ãã¾ããã io
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}