<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>KMS Dev log</title>
    <link>https://thouy.github.io/</link>
    <description>Recent content on KMS Dev log</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 20 Jan 2023 12:38:44 +0900</lastBuildDate><atom:link href="https://thouy.github.io/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fluent Bit Install</title>
      <link>https://thouy.github.io/posts/logging/fluent_bit_install/</link>
      <pubDate>Fri, 20 Jan 2023 12:38:44 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/logging/fluent_bit_install/</guid>
      <description>
        
          
            개요 Fluentd 경량화 버전인 Fluentd Bit을 설치하는 과정을 정리한 글입니다.
Requirements Cmake Flex YAML headers OpenSSL headers 1$ sudo apt-get install cmake, flex Install 1. Fluent Bit 소스코드 다운로드 1$ wget https://github.com/fluent/fluent-bit/archive/refs/tags/v2.0.8.tar.gz 2. build 디렉토리로 이동하여 Cmake 커멘드 실행 1$ cd fluent-bit-v2.0.8/build 2$ cmake ../ 3. make 커멘드 실행 1$ make 4. Fluent Bit 설치 1$ sudo make install 설치가 완료되면 /usr/local/bin 아래에 설치됩니다. 설정파일은 /usr/local/etc/fluent-bit/fluent-bit.conf에 있습니다. Configuration CPU, Disk, Memory, Network IO, Syslog를 tailing 하는 설정을 추가하려고 합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Telegraf vs Fluentd vs Fluent Bit</title>
      <link>https://thouy.github.io/posts/logging/telegraf_versus_fluentd_versus_fluent_bit/</link>
      <pubDate>Fri, 20 Jan 2023 12:37:47 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/logging/telegraf_versus_fluentd_versus_fluent_bit/</guid>
      <description>
        
          
            개요 오픈소스 기반 대표적인 Metrics collector인 Telegraf, Fluentd, Fluent Bit을 비교하고자 합니다.
Telegraf vs Fluentd vs Fluent Bit Category Telegraf Fluentd Fluent Bit Scope Containers / Servers Embedded Linux / Containers / Servers Language Go Ruby &amp;amp; C C Memory About 35MB About 30MB About 650KB Dependencies Zero dependencies RubyGem Zero dependencies Binary size About 152M About 5.1M About 31M Support CPU metrics plugin Oinputs.cpu X OCPU plugin Support Disk metrics plugin Oinputs.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Fluentd &#43; OpenSearch 로그 모니터링 시스템 구축기</title>
      <link>https://thouy.github.io/posts/logging/fluentd_opensearch_log_monitoring/</link>
      <pubDate>Thu, 19 Jan 2023 12:25:12 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/logging/fluentd_opensearch_log_monitoring/</guid>
      <description>
        
          
            개요 Fluentd + OpenSearch를 결합하여 syslog를 수집하는 시스템을 구축하는 내용에 대한 기록입니다.
준비물 Ubuntu 20.04.5 LTS Fluentd가 설치된 환경 (버전 : v1.15.3) OpenSearch가 설치된 환경 (버전 : v2.4.1) 시스템 관련 디렉토리 정보 타켓 로그파일 : /var/log/syslog (rsyslog 데몬의 설정을 참고합니다. /etc/rsyslog.d/50-default.conf) Fluentd 설정파일 : /etc/fluentd/fluent.conf Fluentd 로그 관리용 디렉토리 : /var/log/fluentd 로그 파싱 전략 (syslog 한정) 로그 파싱은 Grok pattern을 활용합니다. syslog 구조 파악 시간, 호스트명, 프로세스명, 프로세스 아이디, 로그 본문으로 구분할 수 있습니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Fluentd Install</title>
      <link>https://thouy.github.io/posts/logging/fluentd_install/</link>
      <pubDate>Thu, 19 Jan 2023 12:24:02 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/logging/fluentd_install/</guid>
      <description>
        
          
            개요 Fluentd는 오픈소스 기반의 Data collector이자 aggregator 입니다. Fluentd를 설치하는 방법은 td-agent 패키지를 이용해서 설치하는 방법과 소스를 직접 빌드하여 설치하는 방법이 있습니다. 본 글에서는 소스를 직접 빌드하여 Fluentd를 설치했던 과정을 다룹니다. 직접 설치했던 경험을 기반으로 작성되었습니다. 이 글이 Fluentd를 standalone으로 설치하시려는 분들에게 도움이 되셨으면 합니다. 설치 환경은 Ubuntu 20.04.5 LTS 입니다.
준비물 Ruby source code archieve (v3.2.0) Fluentd source code archieve (v1.15.3) 설치 1. Ruby 설치 루비는 Fluentd 소스를 빌드하기 위해 필요하기 때문에 먼저 루비를 장비에 설치해야 합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Websocket</title>
      <link>https://thouy.github.io/posts/web/websocket/</link>
      <pubDate>Thu, 19 Jan 2023 12:23:09 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/web/websocket/</guid>
      <description>
        
          
            등장배경 과거에는 클라이언트-서버간 양방향 통신이 필요한 웹 애플리케이션을 만들기 위해서는, HTTP가 남용될 수 밖에 없었습니다. 왜냐하면 upstream, downstream을 별도의 HTTP 연결로 전송해야 했기 때문입니다. 이로 인해 다양한 문제들이 발생하게 됩니다.
서버는 클라이언트별로 복수 개의 TCP 연결을 사용해야만 합니다. (하나는 클라이언트로 메세지를 보내기 위한 연결, 다른 하나는 upstream을 받기위한 연결) 결국 높은 오버헤드를 발생시키게 됩니다. 클라이언트는 서버로부터 온 메세지에 대한 응답을 위해서 서버와의 커넥션을 유지 및 관리해야 합니다. 이러한 문제를 해소하기 위해 WebSocket 프로토콜이 등장합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>Hugo로 Github 블로그 생성하기</title>
      <link>https://thouy.github.io/posts/etc/hugo_github_blog/</link>
      <pubDate>Thu, 19 Jan 2023 11:55:29 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/etc/hugo_github_blog/</guid>
      <description>
        
          
            개요 Hugo로 Github 블로그를 생성하는 내용을 소개하고자 합니다. Ubuntu 20.04.5 LTS 환경에서 진행했습니다.
준비물 Go 1.18 버전 이상 gcc 컴파일러 블로그 파일을 업로드할 Github 레퍼지토리 (레퍼지토리 이름은 Github_유저명.github.io 형태로 지정해주세요) 설치 1. Hugo 소스 빌드하기 Github에서 Hugo 소스코드를 clone 받아서 go로 빌드합니다.
1$ go install -tags extended github.com/gohugoio/hugo@latest 2$ hugo version hugo version 명령으로 버전 내용이 잘 출력되면 Hugo 설치는 마무리 됩니다.
2. Hugo로 블로그 프로젝트 생성하기 hugo 명령으로 새로운 site를 생성합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>[OS] 스레드(Thread)</title>
      <link>https://thouy.github.io/posts/etc/thread/</link>
      <pubDate>Thu, 19 Jan 2023 10:21:50 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/etc/thread/</guid>
      <description>
        
          
            개요 스레드는 어떠한 프로그램 내에서, 특히 프로세스 내에서 실행되는 흐름의 단위를 말합니다. 일반적으로 프로그램은 하나의 스레드를 가지지만, 프로그램에 따라서 둘 이상의 스레드를 동시에 실행할 수도 있습니다. 이러한 방식을 멀티스레드(Multithread) 라고 합니다.
웹서버의 멀티스레드 예시 Dispatcher 스레드가 네트워크를 통해 외부에서 전송된 리퀘스트(request)를 읽어옵니다. 리퀘스트를 읽어온 후에, Worker 스레드를 깨워 리퀘스트를 처리하도록 합니다. Worker 스레드가 깨어나면 리퀘스트가 웹 페이지 캐시로 처리가 가능한지 확인합니다. 만약 캐시로 처리할 수 없는 리퀘스트라면 디스크에서 필요한 데이터를 로드하게 되는데, 디스크 작업이 완료될 때까지 Worker 스레드는 block 됩니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>[Golang] Goroutine VS Thread</title>
      <link>https://thouy.github.io/posts/golang/goroutine_versus_thread/</link>
      <pubDate>Wed, 18 Jan 2023 17:00:16 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/golang/goroutine_versus_thread/</guid>
      <description>
        
          
            고루틴(Goroutine)은 Go 런타임이 관리하는 경량쓰레드입니다. 이번 포스팅에서는 OS 레벨의 쓰레드와 고루틴이 어떠한 차이가 있는지 살펴보고자 합니다.
[OS] 스레드(Thread)
메모리 점유 측면 고루틴은 생성 시 약 2KB의 스택 메모리 공간을 소모합니다. 필요에 따라 힙 메모리를 사용하기도 합니다. 쓰레드는 쓰레드가 사용할 메모리 공간과 더불어 Guard Page로 불리는 쓰레드와 쓰레드 사이의 메모리 공간까지 포함하기 때문에 약 1MB의 메모리 공간을 소모합니다. 때문에 쓰레드를 생성하면 할수록 가용 힙 메모리 공간이 계속 줄어드는 문제점이 있습니다. 생성 및 소거 비용 측면 고루틴은 Go 런타임이 논리적으로 생성하고 소거되므로 생성/소거에 드는 비용이 저렴합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>[Golang] Goroutine &amp; Channel</title>
      <link>https://thouy.github.io/posts/golang/goroutine_and_channel/</link>
      <pubDate>Wed, 18 Jan 2023 16:58:59 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/golang/goroutine_and_channel/</guid>
      <description>
        
          
            Goroutine(고루틴) 고루틴은 Go 런타임이 관리하는 가상쓰레드 입니다. Go에서 go 키워드를 사용하여 함수를 호출하면, Go는 런타임시에 새로운 고루틴을 생성합니다. 고루틴은 비동기적으로 함수를 실행하므로, 여러 함수를 동시에 실행하고자 할 때 사용됩니다. 고루틴은 OS의 쓰레드보다 더 가볍게 비동기 동시처리를 구현하기 위해 만들어 졌습니다. 때문에 고루틴은 OS의 쓰레드와 1:1로 대응되지 않고 훨씬 적은 OS의 쓰레드를 사용합니다. Go 런타임이 실행하는 모든 프로그램은 고루틴을 기반으로 동작합니다. main 함수도 고루틴으로 실행됩니다. 때문에 모든 Go 프로그램은 적어도 하나의 (메인)고루틴을 포함합니다.
          
          
        
      </description>
    </item>
    
    <item>
      <title>[Javascript] Hoisting (호이스팅)</title>
      <link>https://thouy.github.io/posts/javascript/hoisting/</link>
      <pubDate>Wed, 18 Jan 2023 15:48:59 +0900</pubDate>
      
      <guid>https://thouy.github.io/posts/javascript/hoisting/</guid>
      <description>
        
          
            호이스팅이란 Hoist는 사전적으로 무거운 물건 및 무언가를 기계 등을 이용하여 위로 끌어 올리는 것(lift)을 의미합니다. 자바스크립트에서 호이스팅은 자바스크립트 Parser가 변수나 함수를 끌어 올려 최상단에 배치하는 것을 말합니다.
실제로 코드가 상단으로 올라가는 것은 아닙니다. 자바스크립트 Parser가 내부적으로 최상단에 끌어 올려서 처리하게 되며, 이 때 메모리 상의 변화는 없습니다.
호이스팅 대상 자바스크립트는 선언 구문만 호이스팅 합니다. 때문에 변수 선언 없이 먼저 변수를 사용하게 되더라도 예외가 발생하지 않습니다. 다만 그 변수는 사용되는 시점에 자동으로 기본 초기화 상태 (var 선언의 경우 undefined)가 됩니다.
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
