小型 VPS 上的 Java Servlet 容器
不久前,我使用的虚拟专用服务器 (VPS) 的 RAM 非常有限。我用它来托管 Jetty。它太慢了,以至于完全无法使用。我认为主要问题与内存有关。我将项目切换到 PHP,问题就消失了。
不用说,我非常犹豫是否要在 VPS 中再次尝试 Java。尽管我的 VPS 中的 RAM 明显更高,但 PHP 似乎针对低 RAM 进行了简化。有人尝试过带有 Servlet 容器的 VPS 并取得了很大成功吗?我的 Java 配置可能很简单吗? PHP 通常是小型 VPS 部署的更好选择吗?
A while back I was using Virtual Private Server (VPS) that had very limited RAM. I used it to host Jetty. It was so slow that it became completely unusable. I believe the main problem was memory-related. I switched the project over to PHP and the problems disappeared.
Needless to say, I'm very hesitant to try Java again in a VPS. Even though the RAM in my VPS is significantly higher, it seems like PHP is streamlined for low RAM. Has anyone tried a VPS with a Servlet container and had a lot of success? Could it have been something simple with my Java config? Is PHP usually the better choice for a small VPS deployment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ServerFault 可能是比这里更好的地方,但根据我的经验,128 太低了。我在 Linode VPS 上运行 Tomcat 实例,保证内存为 1 GB,没有遇到任何问题。在我的例子中,特定站点的流量也非常低,因此我无法在重负载下保证它。
“突发”表示您的 VPS 有时可能会被授予超过 128 兆的访问权限(取决于整体服务器的使用情况) )。对于服务器实例,对此内存的访问应该被认为是不可靠的,最好假设最坏的情况只有 128 兆。
换句话说,为更多内存付出更多 =)
编辑:
祈求,你们就会收到。 Top 报告 1025 兆虚拟内存,以及 416 兆预留。这是迄今为止在我的 VPS 上运行的最大内存占用。
ServerFault may be a better place to ask that than here, but in my experience 128 is dreadfully low. I run a Tomcat instance on a Linode VPS with 1 gig of guaranteed memory and haven't had any issues. The particular site in my case also has very low traffic, so I can't vouch for it under heavy loads
The 'Burst' signifies that your VPS may be given access to more than your 128 megs at times (depending on the overall server usage). For a server instance, access to this memory should be considered unreliable and your better off assuming the worst case scenario of only having 128 megs.
In other words, pay more for more memory =)
Edit:
Ask and ye shall receive. Top reports 1025 megs virtual memory, and 416 megs reserved. It's by far the largest memory hog running on my VPS.