由于生成的正则表达式(慢速问题),awstats LogFormat选项可以使更新速度变慢吗?

时间:2015-06-12 12:59:59

标签: performance perl awstats

我正在测试awstats一段时间,以决定是否可以使用它来为我的网站(很多虚拟主机)生成统计信息。一些信息:

  • 每个日志文件大约有100 MB(平均值);
  • 我使用专用服务器,我可以看到有免费的处理器和内存来进行更新(Xeon E5620 @ 2.40GHz,四核 - 八线程);
  • 我已禁用DNSLookup(我已经使用tcpdump测试过,服务器没有查询DNS);
  • 我已经配置了geoip模块;
  • URL *参数均为0(无特殊配置);
  • 我使用的是Ubuntu 14.04 LTS(它也很容易在FreeBSD 10上测试);我已经在使用FreeBSD 10的Core i7主机上进行了测试;
  • 我使用为x86_64-linux-gnu-thread-multi构建的perl 5,版本18,subversion 2(v5.18.2)
  • 我的LogFormat是:

LogFormat="%other %other %other %other %other %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"

  • 启用调试后,我可以看到:

PerlParsingFormat是(?^:^[^ ]+ [^ ]+ [^ ]+ [^ ]+ [^ ]+ ([^ ]+) [^ ]+ ([^\/[]+) [([^ ]+)( [^ ]+)?] \"([^ ]+) ([^ ]+)(?: [^\"]+|)\" ([^ ]+) ([^ ]+) \"([^\"])\" \"([^\"]*)\")

  • SiteDomain和HostAlias具有虚拟主机FQDN。

当我运行awstats来分析我的日志文件时,我只能达到10行/秒。使用htop,我可以看到使用100%只有一个CPU线程的awstats.pl进程。服务器内存保持正常,很多都是免费的。

我不知道要改变什么才能使用awstats。我认为使用自定义LogFormat会生成一个与Perl一起使用的速度非常慢的正则表达式。

在awstats网站上,有一些与CPU功率,日志大小和其他变量相关的基准测试结果。但是,这些测试使用LogFormat=1

任何人都可以帮助我吗?

-

编辑:我的日志文件的5行(已清理:host.mydomain.com是我的服务器,0.0.0.0是来自客户端的IP)

Jun 13 14:53:21 host.mydomain.br httpd-access: 0.0.0.0 - - [13/Jun/2015:14:53:20 -0300] "-" 408 - "-" "-" Jun 13 14:53:21 host.mydomain.br httpd-access: 0.0.0.0 - - [13/Jun/2015:14:53:20 -0300] "GET /cgi-bin/SMS/STINGm/start_applet_chime.pl?1bx1,1bx1 HTTP/1.1" 200 16210 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" Jun 13 14:53:22 host.mydomain.br httpd-access: 0.0.0.0 - - [13/Jun/2015:14:53:21 -0300] "GET /Repositorio/oferta_000fl6un19i02wyiv80ispcrrkg1vg1w.gif HTTP/1.1" 200 4349 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; ms-office; MSOffice 14)" Jun 13 14:53:22 host.mydomain.br httpd-access: 0.0.0.0 - - [13/Jun/2015:14:53:21 -0300] "GET /zoneamento/tabelas/SP/SANTA_CRUZ_DA_CONCEICAO_G.HTML HTTP/1.1" 304 - "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" Jun 13 14:53:23 host.mydomain.br httpd-access: 0.0.0.0 - - [13/Jun/2015:14:53:22 -0300] "GET /Repositorio/oferta1_000fl6uo9lz02wyiv80ispcrr1h2o7hx.gif HTTP/1.1" 200 8279 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; ms-office; MSOffice 14)"

0 个答案:

没有答案