douyan6958 2014-01-30 00:26
浏览 11

使用WHM在Centos 6.5上进行AutoKill处理

I have 3gp files that are uploaded to my server via php. From there FFmpeg will convert the 3gp files to mp3 files. Sometimes the 3gp files are corrupt and FFmpeg will hang on that file and max out that core until the process is killed manually via WHm using the process manager.

There have been times when several of these files bring the server to a grinding halt because ffmpeg has maxed out all cores.

Is there a plugin or script or something I can install on the server that can auto kill any process that exceeds a certain amount of time and 90% cpu?

Centos 6.5 Using WHM I have root access.

  • 写回答

1条回答 默认 最新

  • dtrnish3637 2014-01-30 01:23
    关注

    There are several ways you can do this based on resource consumption of the process, but I don't think if there is a way to kill the process gracefully. It means that if any of these methods, kill your process, your video may have been compiled half-way. Here are a few suggestions:

    1. Try to nice your FFmpeg process first; this generally solves a lot of problems;
    2. If you want to kill the process definitely, there are some tools for that. One is monit

    You just have to programmatically generate pid files for your ffmpeg process and multiple monit configuration.

    There is also another tool called cpulimit that you can use to limit CPU usage per process. Here is a link on Ubuntu but I am sure CentOS has it too:

    http://ubuntuforums.org/showthread.php?t=992706

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集