libevent 사용해보신 분 계신가요?

kukuman의 이미지

나름대로 select와 poll의 단점을 보완했다고 하던데,,,

사용해 보신 분 계시면 어떤지 좀 알려주시면 감사하겠습니다~

오늘도 즐플^^

choissi의 이미지

제가 느낀 장단점은

장점:
이벤트 핸들러 방식으로 네트워크 프로그래밍이 가능하다.
select/poll/kqueue를 단일 인터페이스로 제공

단점:
너무 많은 기능이 추가되어서 fd당 자료구조가 너무 크다.

울랄라~ 호기심 천국~!!
http://www.ezdoum.com

kukuman의 이미지

우선 답변 감사드리구요^^~

혹시 성능 부분에서는 어떤지도 알 수 있을까요?

메모리를 많이 먹기는 하지만,,,
속도나 안정성은 괜찮은지요??

웹사이트 가보면 그래프등 자료가 있긴 하지만,,,
거긴 아무래도 자신들이 만들어 놓은 자료들이라^^;;

가능하다면 직접 사용해보신 분들의 느낌이나 생각을 알고 싶네요...

Be at a right place at a right time...

sylphong의 이미지

libevent는 안써봤지만 libepoll을 사용해서 epoll은 써봤습니다..
간단한 에코서버를 만들어서 poll과 epoll을 비교해봤습니다..
테스트 서버는 펜티엄 233MHz 메모리128MB이며 클라이언트는 아무일도 안하고 접속만 계속 요청하게해서 걸리는 시간을 측정했습니다.
poll의 경우는 소켓이 2000개가 넘어가니 급속도로 속도가 느려짐을 확인할수가 있었습니다. 반면 epoll은 일정한 속도를 유지하더군요..
물론 서버를 만들때는 poll하나만 써는 일은 드물겠죠..여러가지 기법이 사용됩니다만 그냥 단순히 poll과 epoll을 비교했을땐 epoll이 훨씬 나은 퍼포먼스를 보여주더군요..(당연한결과인듯..-_-;;)
아래 테스트 결과를 첨부했으니 참조하세요..

소켓수 100개
EPOLL
real 0m0.299s
user 0m0.020s
sys 0m0.030s
POLL
real 0m0.240s
user 0m0.000s
sys 0m0.080s

소켓수 1000개
EPOLL
real 0m10.336s
user 0m0.000s
sys 0m0.140s
POLL
real 0m10.252s
user 0m0.020s
sys 0m0.200s

소켓수 3000개
EPOLL
real 0m30.132s
user 0m0.000s
sys 0m0.030s
POLL
real 2m30.106s
user 0m0.010s
sys 0m0.030s

소켓수 5000개
EPOLL
real 0m50.189s
user 0m0.000s
sys 0m0.060s
POLL
real 11m41.188s
user 0m0.000s
sys 0m0.060s

소켓수 10000개
EPOLL
real 1m49.375s
user 0m0.000s
sys 0m0.150s
POLL
테스트못함.

kukuman의 이미지

답변 감사합니다~

많은 도움이 되었네요 :o

흠...

결론적으로 select와 poll이 대량의 처리에는 정말 별로군요 :?

Be at a right place at a right time...

익명 사용자의 이미지

서버컴에서 소켓 63개로 초당 12000리퀘스트를 감당하더군요. 씨피유는 펑펑 놀면서요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.