Hadoop 工作负载
我目前正在使用hadoop 中的wordcount 应用程序作为基准。我发现 CPU 使用率几乎稳定在 80-90% 左右。我希望 CPU 使用率有波动。有没有任何hadoop应用程序可以给我这种能力?多谢。
I am currently using wordcount application in hadoop as a benchmark. I find that the cpu usage is fairly nearly constant around 80-90%. I would like to have a fluctuating cpu usage. Is there any hadoop application that can give me this capability? Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有办法限制或指定 hadoop 使用的范围。 Hadoop 将使用可用的 CPU。当我从事很多工作时,我的成功率始终保持在 90% 以上的范围内。
控制 CPU 使用率的一种方法是更改每个任务跟踪器可以同时运行的映射器/缩减器的最大数量。这是通过
$HADOOP_HOME/conf/core-site.xml
中的mapred.tasktracker.{map|reduce}.tasks.maximum
设置。当映射器/减速器的数量有限时,它将在该任务跟踪器上使用更少的 CPU。
另一种方法是在设置作业时设置
mapred.tasktracker.{map|reduce}.tasks
的配置值。这将迫使该作业使用那么多映射器/减速器。该数字将分配给可用的任务跟踪器,因此,如果您有 4 个节点并希望每个节点有 1 个映射器,您可以将mapred.tasktracker.map.tasks
设置为4
。也有可能,如果一个节点可以运行 4 个映射器,那么它将运行所有 4 个映射器,我不知道 hadoop 究竟如何分割任务,但每个作业强制一个数字是一种选择。我希望这能帮助您到达目的地。我还是不太明白你在找什么。 :)
I don't think there's a way to throttle or specify a range for hadoop to use. Hadoop will use the CPU available to it. When I'm running a lot of jobs, I'm constantly in the 90%+ range.
One way you can control the CPU usage is to change the maximum number of mappers/reducers each tasktracker can run simultaneously. This is done through the
mapred.tasktracker.{map|reduce}.tasks.maximum
setting in$HADOOP_HOME/conf/core-site.xml
.It will use less CPU on that tasktracker when the number of mapper/reducers is limited.
Another way is to set the configuration value for
mapred.tasktracker.{map|reduce}.tasks
when setting up the job. This will force that job to use that many mappers/reducers. This number will be split across the available tasktrackers, so if you have 4 nodes and want each node to have 1 mapper you'd setmapred.tasktracker.map.tasks
to4
. It's also possible that if a node can run 4 mappers, it will run all 4, I don't know exactly how hadoop will split out the tasks, but forcing a number, per job, is an option.I hope that helps get you to where you're going. I still don't quite understand what you are looking for. :)