免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3158 | 回复: 1
打印 上一主题 下一主题

请教一个perl处理大数据量log记录的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-12-03 18:11 |只看该作者 |倒序浏览
服务器启动后使用的log文件,会在短时间内生成大量的log记录(大概5分钟内4万条记录)

每条log的形式大概为:   "the device id is $id and the server ip is $ipaddress"

例如段时间内生成这样的log:
---------------------------------------------------------------------
the device id is 1 and the server ip is 10.1.1.1
the device id is 2 and the server ip is 10.1.1.2
the device id is 3 and the server ip is 10.1.1.3
the device id is 4 and the server ip is 10.1.1.4
the device id is 5 and the server ip is 10.1.1.5
the device id is 6 and the server ip is 10.1.1.6
the device id is 7 and the server ip is 10.1.1.7
the device id is 8 and the server ip is 10.1.1.8
....
....
the device id is 400000 and the server ip is 10.253.1.8
------------------------------------------------------------------------

我想实现perl实时获取生成的log,并把$id和$ipaddress 获取到存入内存hash。

我知道实现上述功能并不难,我的疑惑就在于如果这些实时的log是在短时间内生成的,例如每秒3000条,perl能处理的了吗,请高手指点一下思路吧

论坛徽章:
42
19周年集字徽章-周
日期:2019-10-14 14:35:31平安夜徽章
日期:2015-12-26 00:06:30数据库技术版块每日发帖之星
日期:2015-12-01 06:20:002015亚冠之首尔
日期:2015-11-04 22:25:43IT运维版块每日发帖之星
日期:2015-08-17 06:20:00寅虎
日期:2014-06-04 16:25:27狮子座
日期:2014-05-12 11:00:00辰龙
日期:2013-12-20 17:07:19射手座
日期:2013-10-24 21:01:23CU十二周年纪念徽章
日期:2013-10-24 15:41:34IT运维版块每日发帖之星
日期:2016-01-27 06:20:0015-16赛季CBA联赛之新疆
日期:2016-06-07 14:10:01
2 [报告]
发表于 2014-12-04 09:48 |只看该作者
3000r/s
没问题.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP