就我的情况而言,Hadoop 会给我带来更多好处吗?

发布于 2024-11-27 17:52:03 字数 192 浏览 0 评论 0原文

我使用 Clojure 每小时提取 10 个 XML 文件,每个文件大约 10 MB。该脚本正在服务器计算机上运行。
XML 文件现在被解析并存储到 RDBMS 中(所有操作都是使用本机 Clojure 代码完成的)。

考虑到我的情况,如果我使用 Hadoop Map/Reduce 来解析 XML 文件,我是否会获得更多好处?或者它会矫枉过正?

I'm using Clojure to pull ten XML files hourly, each file is about 10 MB. This script is running on a server machine.
XML files are parsed and stored into RDBMS right now (all is done using native Clojure code).

Considering my case, Am I going to gain more benefits if I used Hadoop Map/Reduce to parse the XML files? or it will be overkill?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缘字诀 2024-12-04 17:52:03

在这种情况下,使用 Hadoop 肯定是大材小用。如果你要使用 Hadoop 并行解析 10 个文件,

  • 它会从每个 Map 任务生成 10 个 JVM
  • ,它可以为 Reduce 任务生成另外 1 个 JVM(当然,你可以有一个仅 Map 的 hadoop 作业,而你不需要 Reduce 阶段)
  • Map 和Reduce 阶段之间会有一个shuffle 阶段,其中所有Map 输出都通过网络发送到Reduce 节点

如果您的文件每个最大为10 Mb,那么我看不到太多优势,事实上您会看到JVM 启动和过多 IO 会产生大量开销。

我想说,一旦每个文件超过 100 - 150 Mb,您就应该考虑 Hadoop

Using Hadoop would definitely be an overkill in this case. If you were to use Hadoop to parse 10 files, parallely,

  • It would spawn 10 JVMs from each Map task
  • It could spawn 1 more JVM for the reduce task (ofcourse you could have a map only hadoop job where u wont need a reduce phase)
  • There would be a shuffle stage between the Map and Reduce phase where all Map output is sent across the network to the reduce node

If your files are each a max of 10 Mb, then I dont see much advantage and you will infact incur significant overhead from the JVM starts and excessive IO.

Id say you should consider Hadoop once you cross 100 - 150 Mb per file

三岁铭 2024-12-04 17:52:03

我有两个 clojure 示例可供您进行比较:

  • 1 个应用程序解析数千个 xml 文件,每个文件大小约为 1 Mb 或更小,并且在正常负载下每个文件的处理时间约为 50 毫秒。
  • 1 个其他应用程序对相对较大的日志文件进行处理,每个日志文件 50mb-100mb,每个处理时间约为 1-2 秒。

当然,这取决于服务器的处理能力,但一切都是在 Clojure 中完成的,没有任何瓶颈的迹象。

I have two clojure examples that you could use for comparison:

  • 1 application parsing thousands of xml files each around 1Mb or less, and processing is around 50ms each under normal load.
  • 1 other application doing processing on relatively big log files, each of 50mb-100mb, and processing is around 1-2seconds each.

Of course, this depends on the server processing power, but everything is done in clojure, without any hint of a bottleneck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文