每秒获取低轨混合请求(每秒 8-15 个)

发布于 2024-09-06 13:01:46 字数 379 浏览 3 评论 0原文

因此,我在具有多个设置(服务器/应用程序)的多台计算机上进行了尝试,并且我似乎始终让 Rails 每秒完成 8-15 个请求,即使是在具有 1 个字段的空表上进行选择。我认为我在这里做错了什么,因为我在网上阅读了很多统计数据,其中人们对杂种的得分为 60-200。所以八点钟就倒下似乎很糟糕。我测试的第一个应用程序有点复杂,在 1 个控制器中有 2 个查询,但它们只是选择几行,没什么大不了的。

这其中有什么我没有意识到的技巧吗? Ruby.exe 占用了我近 50% 的 CPU 周期,但这仍然很糟糕。我觉得我去年在搞乱 Rails 时就尝试过这个,并且每秒收到了大约 50 个请求。有没有可能路由被搞砸了?

任何建议将不胜感激。即使是分析工具的信息,我至少可以找出问题发生在哪里。

提前致谢。

So I have tried this out on multiple computers with multiple setups (servers/apps) and I seem to consistently get Rails completing 8-15 requests per second even for doing selects on empty tables with 1 field. I think I'm doing something wrong here because I've read a lot of stats online where people are getting 60-200 with mongrel. So being down at 8 seems just awful. The first app I tested this on was a little more involved and had 2 queries in 1 controller but they were just selecting a few rows, not a big deal.

Is there some trick to this I don't realize? Ruby.exe is taking up nearly 50% of my cpu cycles but still this is pretty bad. I feel like I've tried this when messing with rails last year and have gotten something like 50 requests per second. Is it possible that routing is screwed up some how?

Any advice would be greatly appreciated. Even info as far as profiling tools go so I could at least figure out WHERE the problem is occurring.

Thanks ahead of time.

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

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

发布评论

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

评论(1

花期渐远 2024-09-13 13:01:46

如果你使用的是 Windows,那么这似乎是正确的。 Rails 在 Windows 上运行速度非常慢。尝试在 Linux 机器上运行它,如果有的话,也可以在 Mac 机器上运行。你也可以尝试heroku。他们有一个免费的入门计划,您可以使用它进行开发。

如果您必须在 Windows 环境中运行,您可以尝试 jruby 以获得额外的速度。

If you're on windows then that seems about right. Rails runs terribly slow on windows. Try running it on a linux box, or a mac if you have one. You could also try heroku. They have a free starter plan you can use for development.

If you must run in a windows environment you could try jruby for some extra speed.

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