ただのメモです。
visitorsを使ってたんだけど、数Gのファイルを処理してたら、Refererとrequestにparameterの種類が多すぎてメモリ足らなくてswapしまくって大変なことになった。
visitorsのメモリ節約のため下記のパッチをあてて、?以降のパラメータを削除して、パラメータが異なるreferer/requestを全て同一としてカウントするようにした。
--- visitors.c.orig 2006-03-31 00:31:49.000000000 +0900 +++ visitors.c 2012-02-11 16:53:33.000000000 +0900 @@ -1318,6 +1318,7 @@ int vi_process_referer(struct vih *vih, char *ref, time_t age) { int res; + char *pos; /* Check the url against the blacklist if needed * this can be very slow... */ @@ -1331,6 +1332,10 @@ return !vi_counter_incr(&vih->referers, "Google Search Engine"); res = vi_counter_incr(&vih->referers, ref); if (res == 0) return 1; + + if (NULL != (pos = strchr(ref,'?'))) + *pos = '\0'; + /* Process the referers age if enabled */ if (Config_process_referers_age) { if (vi_replace_if_older(&vih->referersage, ref, age)) return 1; @@ -1345,6 +1350,9 @@ { int res; char urldecoded[VI_LINE_MAX]; + char *pos; + if (NULL != (pos = strchr(url,'?'))) + *pos = '\0'; vi_urldecode(urldecoded, url, VI_LINE_MAX); if (vi_is_image(url))