使用“apt”或者从头开始编译 Web 服务?
我第一次编写一个 Web 服务,它将调用外部程序来批量处理请求。前端将接受文件上传,然后将它们放入队列中。后端的工作人员将获取该文件,通过 ffmpeg 和管道的其余部分运行它,并在该过程完成时发送电子邮件。
我的后端进程在我的计算机上运行(Ubuntu 10.04)。问题是:我应该尝试使用我从头开始编译的二进制文件重新创建该管道吗?或者在现实世界中配置时可以使用 apt 吗?
并非所有托管服务都使用 Ubuntu,也并非所有服务都给予我 root 访问权限。 (我还没有选择主机。)但是,他们会让我上传二进制文件来执行,并且许多人给我使用 gcc
进行 shell 访问。
通常这很容易,我会从头开始编译它。但这样做 - 更不用说尝试弄清楚如何创建独立于平台的 .tar.gz 二进制文件 - 将是一项相当大的任务,最终并不能真正帮助我发布我的产品。
您对设置我的堆栈的最佳方式有什么想法,这样我就不会受到特定托管提供商的束缚?我是否应该尝试创建自己的 .deb,其中包含 Ubuntu 版本的 ffmpeg(和其他工具)以及我需要的配置?
如果没有管理自己的服务器/虚拟机的设置(这很可能是我必须做的),我该如何实现这一点?
For the first time, I am writing a web service that will call upon external programs to process requests in batch. The front-end will accept file uploads and then place them in a queue. The workers on the backend will take that file, run it through ffmpeg and the rest of my pipeline, and send an email when the process is complete.
I have my backend process working on my computer (Ubuntu 10.04). The question is: should I try to re-create that pipeline using binaries that I've compiled from scratch? Or is it okay to use apt
when configuring in The Real World?
Not all hosting services uses Ubuntu, and not all give me root access. (I haven't chosen a host yet.) However, they will let me upload binaries to execute, and many give me shell access with gcc
.
Usually this would be a no-brainier and I'd compile it all from scratch. But doing so - not to mention trying to figure out how to create a platform-independent .tar.gz binary - will be quite a task which ultimately doesn't really help me ship my product.
Do you have any thoughts on the best way to set up my stack so that I'm not tied to a specific hosting provider? Should I try creating my own .deb, which contains Ubuntu's version of ffmpeg (and other tools) with the configurations I need?
Short of a setup where I manage my own servers/VMs (which may very well be what I have to do), how might I accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
情况正好相反:恕我直言,在现实世界中以未打包的方式部署是不行的
您将如何在没有 root 访问权限的情况下部署 .deb。 Chroot监狱?
+1 你回答你自己的问题。除非必要,否则不要插手。
仅依赖于封装良好的标准库(例如 ffmpeg)。否则将它们包含在您自己的部署中。对于几十年来成千上万的 Linux 应用程序来说,解决这个问题并不是太难,所以它对您来说可能也是可行的。
开箱即用:
查看 rightscale 和其他拥有专门用于视频编码的图像/工具链的云提供商/代理。
“常规”VPS 提供商(使用 Xen 或 Virtuozzo)通常不会对此类工作负载感到满意,但 EC2、Rackspace 及其产品绝对可以接受。
一般来说,我不相信不授予根访问权限的云基础设施提供商将允许计算密集型工作负载。 $0.02
It is in reverse: it is not okay to deploy unpackaged in The Real World IMHO
How would you be deploying a .deb without root access. Chroot jails?
+1 You answer you own question. Don't meddle unless you have to.
Only depend on wellpackaged standard libs (such as ffmpeg). Otherwise include them in your own deployment. This problem isn't too hard too solve for 10s of thousand Linux applications over decades now, so it would probably be feasible for you too.
Out of the box:
Look at rightscale and other cloud providers/agents that have specialized images/tool chains especially for video encoding.
A 'regular' VPS provider (with Xen or Virtuozzo) will not normally be happy with these kinds of workload, but EC2, Rackspace and their lot will be absolutely fine with that.
In general, I wouldn't believe that a cloud infrastructure provider that doesn't grant root access will allow for computationally intensive workloads. $0.02