タグ

ブックマーク / kzk9.net (12)

  • Multi-Threaded HTTP Server using evhttp | kzk's blog

    Few months ago, I need to write the multi-threaded http server which can be embedded into the C++ server. At that time, the performance and the stability was the most important point. I found the evhttp library, which is included in the libevent. evhttp is HTTP server/client library built on top of the libevent event loop. Single-Threaded Server The following code is a simple evhttp server. But th

  • libevent-1.3b, libmemcached-1.4.4 で固まる? - moratorium

    libevent-1.3b, libmemcached-1.4.4 で固まる? 2010-08-13 (Fri) 0:56 Uncategorized mixiの件について、nealさんから情報を貰ったので数時間調査してみた。というのも、うちの製品でもlibevent(evhttp)をリクエスト処理に使っているので、これにバグが有ると非常に困る。 Nealさんのつぶやき ひとまず、libevent-1.3b, libmemcached-1.4.4をビルドする。memcachedは、-cで同時接続数を制限できる。で、この同時接続数というのは、実はファイルディスクリプタの数を制限する事で達成されている。memcached.cの以下の部分。 /* * If needed, increase rlimits to allow as many connections * as needed. */

  • kzk's blog - Writing TokyoCabinet wrapper for Go language

    In this entry, I try to introduce how to use FFI (Foreign Function Interface) of Go. I choosed to write the wrapper for TokyoCabinet, a database library. To call C and C++ code from go, you need to use cgo command. And the simple example is contained in go distribution ($GOROOT/misc/cgo/stdio and $GOROOT/misc/cgo/gmp). cgo commands converts *.go files into *.c and *.go files. Then compiles them an

  • Hadoop World NYC 参加記 - moratorium

    Hadoop World NYC 参加記 2009-10-07 (Wed) 10:03 Hadoop と言う訳でHadoop World NYC, 2009の参加記を書きます。 1日目はSystem Administrator用のトレーニングコースを受け、2日目がカンファレンス番でした。トレーニングコースはDeveloper向け(3日間)とManager向けのビジネス寄りのコースが有り、合計で100人ぐらいは参加していたと思います。カンファレンスの番自体は400~500人の参加でした。 まずSystem Adminコースですが、大体以下のような内容でした。 MapReduceの基概念 ハードウェア/ネットワーク機器の選定ポイント OSやJavaなど、ソフトウェアでの注意点 Hadoop(Cloudera Distribution)のインストール方法 パラメーター/パフォーマンスチュー

  • HaSL: SL(1) in Haskell

    2006/03/09 Kazuki Ohta Introduction This is a clone program of SL(1), 'Ultimet Joke Command' by Masashi Toyoda, but written in Haskell. So the name is Ha-SL! Author Kazuki Ohta Download This is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License Source HaSL.hs Build

    sotarok
    sotarok 2009/10/01
    sl コマンド
  • moratorium | Programming with POSIX threads

    Programming with POSIX threads 9月前半のテストが終了しました。まだ後半の方にも有るので、まだやっていない夏休みの課題をさささっと片付けてしまう事にしよう。それにしてもH木先生はいつテスト日程を決めてくれるのか(笑) 最近はpthreadを用いたthread pooling式のマルチスレッドサーバーアプリケーションと毎日のように格闘しています。pthreadを使うにあたり良いは無いものかとある人に紹介して頂いたのがProgramming with POSIX threadsです。 Programming With Posix Threads (Addison-Wesley Professional Computing Series) David R. Butenhof Addison-Wesley Pub (Sd) 1997-05-06 ¥ 8,528 この

    sotarok
    sotarok 2009/09/29
  • Twinado = Tornado + async-python-twitter - moratorium

    Twinado = Tornado + async-python-twitter 2009-09-23 (Wed) 0:37 Uncategorized Twinadoという携帯向けのTwitterクライアントを書いてみました。日常的に使えるレベルにはなっていると思います。 Twinado: 携帯端末向けTwitterクライアント 特徴としては最近Facebookが公開したTornadoというフレームワークを使って、Twitter API呼び出しが全て非同期に行われている点です。なので、コネクション数が増えても高速に動くはずです。現状DoCoMo P905iでしか動作確認していません。 きっかけとしては、最近Perl界隈で非同期処理が流行っているのを見て、楽しそうだと思っていたところに、Tornadoが公開されたので、少し使ってみるかと思い立った事です。Tornadoについては以下を参考に

  • Amazon Elastic MapReduceを使ってみた - moratorium

    Amazon Elastic MapReduceを使ってみた 2009-04-03 (Fri) 3:06 Amazon EC2 連日のEC2ネタです。日、AmazonからElastic MapReduceというサービスがリリースされました。大規模データ処理技術が一気に民間の手に下りてくる、まさに革命的なサービスだと思います。 Amazon Elastic MapReduce Amazon ElasticMapReduce 紹介ビデオ With Hadoop, Amazon Adds A Web-Scale Data Processing Engine To Its Cloud Computer by techcrunch.com Elastic MapReduceは、Googleの基盤技術の一つであるMapReduceを時間単位課金で実行できるサービスです。MapReduceについては以

  • Key-Value Store 勉強会を開催しました。 - moratorium

    Key-Value Store 勉強会を開催しました。 2009-02-26 (Thu) 3:08 勉強会 もう先週の金曜日になりますが、Key-Value Store勉強会というのを開きました。 既に素晴らしいまとめエントリが有りますので、詳細はこちらをご覧下さい。 Key-Value Store勉強会に行ってきました by katsumaさん Key-Value Store勉強会 by shudoさん はてなブックマーク「kvs」タグ UStream録画動画 by ichiiさん 日経BP社 中田さまには、草の根的勉強会にも関わらず、記事にして頂きました。有難うございます。 「キー・バリュー型データストア」開発者が大集合した夜 また、講師の方々に発表資料等をアップロードして頂いております。 末永さん: 全文検索エンジンgroongaをテストリリースしました 山田さん: About L

    sotarok
    sotarok 2009/09/16
    _・)
  • SOSP 2009適当まとめ - moratorium

    SOSP 2009適当まとめ 2009-08-24 (Mon) 4:39 Uncategorized システム系では最高峰の学会SOSPの最新の論文が公開されていたのを見つけたので、適当に流し読みしてみました。 SOSP 2009: Technical Programs 主に僕の興味の有るやつになります。無いのはリストにすら入ってないので、ご注意を。特にセキュリティ周りとか。しかしHadoopを利用した論文が結構多い。MapReduce流行り過ぎ。 - FAWN: A Fast Array of Wimpy Nodes 遅いCPUとFlashドライブを並べて低消費電力なストレージを作るというアーキテクチャ「FAWN」を提案。この上に「FAWN-KV」と呼ばれるKey-Value Storeを作成し、実験を行った。Chain-Replication、ノード追加時のプロトコル等が詳しく載って

  • C言語: 実行時間測定の方法

    C言語において実行時間を測定する為の方法はいくつかある。gettimeofday, clock, getrusage, timesを利用する方法である。ここではこれらの方法について検証してみる。これは2005/12/30時点での情報であり、古い亊が考えられるので注意して頂きたい。さらに、内容のほとんどはmanを移しただけなので、正確な情報を得るためにそれぞれの関数のmanを見ることを強く推奨する。 System: Linux 2.6.12 glibc: glibc 2.3.5-1ubuntu12 gettimeofdayを使用する方法 通常はこの関数を使用するのをお勧めする。 gettimeofdayはSVr4, BSD 4.3準拠である。返り値の型はsys/time.hに定義されるstruct timevalで有る。

    sotarok
    sotarok 2009/03/22
  • C(++)言語: valgrindの使い方

    ubuntu% uname -a Linux ubuntu 2.6.12-10-386 #1 Sat Mar 11 16:13:17 UTC 2006 i686 GNU/Linux ubuntu% valgrind --version valgrind-3.0.1 (0) 目次 Valgrindに含まれるツール Memcheck: メモリエラーを検出する(default) Cachegrind: キャッシュミスを検出する Massif: ヒーププロファイラを使う まとめ valgrindの使い方とエラーメッセージを整理してみた。「valgrind --leak-check=full command」というコマンドラインをよく用いる。これによりメモリ周りのバグを検出出来る。 --tool=cachegrindではプログラム実行時のキャッシュミス率を測定する事が出来る。cg_annotateを

    sotarok
    sotarok 2009/03/17
    メモリリークのチェックなど.valgrind.ヒーププロファイラ
  • 1