내가 하는 일은 세상을 (어떻게) 바꾸는가

스스로 최선을 다하게 되는 데는 여러 가지 이유가 있기 마련이다. 나는 주로 내가 하는 일이 이 세상을 어떻게 바꾸게 될 것인가에 대해 주로 생각한다. 그리고 어느 시점까지는 그런 생각을 통해 많은 부분에서 성공적인 시간을 보내 왔던 것 같다.

그런데 최근의 여러 가지 일들을 통해 이 주제에 대해 재고하게 될 기회가 생겼다. 여러 가지 일들이라고 해서 그렇게 특별한 것은 아니다. 주로 업무상의 의도치 않은 일시적 태만이라든지, 학습에의 가볍고 일시적인 강박이라든지, 사소한 일들이 주를 이룬다. 물론 미나 프로젝트를 떠나면서 사색의 시간을 좀 더 할당받았기 때문이라는 큰 이유도 있겠지만.

소프트웨어 개발을 포함한 대부분의 일은 세상을 바꿀 수 있다. 그것이 아무리 하찮을 지라도 세상을 바꾼다는 것은 의심의 여지가 없다. 하지만 동시에 대부분의 일들에 있어 우리의 행위가 세상을 어떻게 바꿀 지에 대해서는 논란의 여지가 크다는 것도 의심의 여지가 없다. 내가 작성한 소프트웨어로 크루즈 미사일 을 제어할 수도, 해저 자원 탐사 로봇을 제어할 수도 있다. 그뿐인가. 크루즈 미사일이 세상을 좋게 바꾸느냐 그렇지 않느냐는 더 큰 논란의 여지를 낳는다.

이런 관점에서 보았을 때, 솔직히 지적 유희나 이윤의 추구를 위한 일이 덜 가치있다고 말할 만한 논거가 잘 떠오르지도 않는다. (참, 그런데 그 가치라는 건 또 어떻게 평가하지?) 그렇게 생각이 꼬리에 꼬리를 물다 보면 세상을 바꾼다는 말이 생각보다는 별로 흥미 진진한 일만은 아닌 게 아닌가 싶어진다. 그렇다고 해서 딱히 스트레스를 받는다거나 하는 것도 아니다. 하지만 뭔가 김빠지는 것만은 틀림없다.

좀 더 현실적인 문제로 돌아갈 필요를 느낀다. 그래서 더 학습에 대해 강한 욕구를 느끼는지도 모르겠다. 하지만 미완의 사색에는 찜찜한 구석이 있다.

Performance Comparison between NIO Frameworks

Most NIO frameworks can saturate 1 gigabit ethernet at some point. However, some frameworks can saturate the bandwidth with the smaller number of connections while others can not. The performance numbers of the 5 well-known open source NIO frameworks are presented here to help you figure out the excellence of Netty in performance.

Where’s the Graph?

If you are in a hurry, please scroll down to see the graphs first. You can also download the PDF document which contains detailed numbers and graphs.

What’s the Bottom Line?

Unlike usual expectations, NIO frameworks have different performance characteristics in spite of the fact that they are using the same NIO selector provider.

What’s observed is that the difference comes from the fundamental factors such as data structure and thread contention management, and those factors should never be overlooked.

Netty has succeeded to introduce the breakthrough in NIO framework performance with careful engineering, while retaining the flexible architecture.

Test Scenario

A simple echo server and client exchange fixed length messages one by one (i.e. synchronous ping-pong). The handler code, which sends the received data back in verbatim, is executed in a separate thread pool that each NIO framework provides.

The tests were run with different message lengths (64 ~ 16384 bytes) and different network configurations (loopback and 1 gigabit ethernet), to see how well each framework performs on various conditions.

Test Environment

  • Software
    • The test client has been written in Netty 3.0.0.CR5.
    • Echo server implementations
      • Netty 3.0.0.CR5
      • Other 4 open source NIO frameworks
        • Grizzly, MINA, NIO Framework, and xSocket
        • Used the latest milestone releases as of October 3rd, 2008
        • Excluded inactive projects (no release in 2008)
        • Framework names were anonymized in no particular order.
      • Thread pool
        • The number of I/O threads – the number of the CPU cores
        • The number of handler threads – 16
        • The default thread pool that each framework provides was used.
        • If the framework doesn’t provide a thread pool implementation which limits the maximum number of threads, Executors.newFixedThreadPool() was used instead.
      • Use of direct buffers was suppressed to avoid excessive memory consumption.
    • JRE – Sun JDK 1.6.0_07
    • JRE options – -server -Xms2048m -Xmx2048m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods
  • Hardware
    • Server (Hostname: Eden)
      • CPU: 2 x quad-core Xeon 2.83GHz, ‘performance’ governor
      • O/S: Linux 2.6.25.11-97.fc9 (Fedora 9)
      • RAM: 6 GiB
      • NIC: Broadcom NetXtreme Gigabit Ethernet PCI express
    • Client (Hostname: Serpent)
      • CPU: 2 x dual-core Xeon 3.00GHz, ‘performance’ governor
      • O/S: Linux 2.6.25.11-97.fc9 (Fedora 9)
      • RAM: 3 GiB
      • NIC: Broadcom NetXtreme Gigabit Ethernet PCI express
    • No switching hub was used to minimized possible network latency.
  • Common TCP/IP parameters
    • TCP_NODELAY was turned on. (i.e. Nagle’s algorithm was disabled.)
    • net.ipv4.tcp_tw_recycle has been set to 1
    • Used the default MTU (i.e. 1500 – no jumbo frame)

Test Result

Client and Server on the Same Machine (Loopback Device)

The test client and servers ran on the same machine, Eden. (If images are not showing up, please refresh. There are three graphs here.)

Size=128, Loopback
Size=1024, Loopback
Size=4096, Loopback

Client and Server on Different Machines (1 Gigabit Ethernet)

The test client ran in Serpent, and the servers ran in Eden. (If images are not showing up, please refresh. There are three graphs here.)

Size=128, 1Gb Ethernet
Size=1024, 1Gb Ethernet
Size=4096, 1Gb Ethernet

Running the Tests by Yourself

The test result should be always reproduceable. Please give us your feed back to improve the accuracy of the test result. The full source code is available at the Subversion repository:

svn co http://anonsvn.jboss.org/repos/netty/subproject/benchmark

All tests run by Ant. Enter ‘ant -p‘ to see the instruction.

유명인으로 산다는 것

누구나 생애 한 번쯤 생각해 보았을 것이다. 자기 자신이 (적어도 어렸을 적에) 대통령이나 연예인이 된다거나, (아주 조금 더 현실적으로) 이름난 엔지니어가 된다거나.

하지만 조금이라도 남의 이목을 받아 본 사람이라면 유명인으로 산다는 것이 얼마나 힘든 일일 지 상상할 수 있다. 언제부턴가 내가 모르는 사람이 나를 이야기하고 알아본다는 신선한 충격은 잠시나마 즐거울 수 있겠지만, 근본적인 거리에 기인한 오해의 깊이는 어찌할 노릇이 없을테니까.

유명세는 그래서 그것을 감당할 수 있는 사람에게 주어져야 한다. 하지만 운명은 항상 우리를 예기치 않은 곳으로 데려가기 마련이어서, 나는 내가 설 그 곳에 지나친 스포트라이트가 나를 비추지 않기를 바랄 뿐이다.

… 물론 내 속의 속물 근성은 좀 다른 것을 원할 것 같지만!