TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Nginx directly to mysql. 3 - 4 times as fast as php + libmysql

98 点作者 base将近 15 年前

13 条评论

CWIZO将近 15 年前
This has maintainability problems written all over it. I can't imagine a web page where you would actually gain something from this, that wouldn't be complex enough that you wouldn't need some language to deal with more complex selects/inserts. And that would mean that you would spread your logic (models?) across two totally different "platforms". One part in nginx conf file (brrr) and the other in your code. Add something like Sphinx into the mix, and you have your SQL all over the place.
rbranson将近 15 年前
In other news, computer scientists discover that evented C code is faster than PHP.
评论 #1449349 未加载
IgorPartola将近 15 年前
Why is it only 3-4 times faster is what surprises me. No question that cutting out the PHP interpreter and VM is going to speed things up, but only ever so slightly?
评论 #1449586 未加载
评论 #1449715 未加载
earle将近 15 年前
Why is this a surprise to anyone? And Nginx to memcache will be even faster... and serving static content even faster...<p>You're adding a tremendous amount of overhead with any high level language stuck in between the connect and the data source.<p>This is about as basic as it gets, not worthy of #1 item on hacker news.
评论 #1448882 未加载
评论 #1448869 未加载
orlandu63将近 15 年前
I'd like to see a benchmark against PHP + mysqlnd (native mysql driver for PHP, which supersedes libmysql as of PHP 5.3)
评论 #1449301 未加载
Lorin将近 15 年前
This keeps reminding me to get off my butt and make some sort of passthrough between nginx and mongodb. Yes, I know there's GridFS development but it doesn't suit my needs.
dylanz将近 15 年前
The title of this post is a bit misleading. It's agentzh (who rocks) announcing two new plugins which have plenty of use-cases.
评论 #1449698 未加载
jackqu7将近 15 年前
This is really interesting, but I wonder if there is any support for user authentication? Perhaps by combining with basic auth?
评论 #1449819 未加载
defied将近 15 年前
This should really speed up my website's autocompletion. Not having to load the rails stack will be a big performance boost.
cdine将近 15 年前
So, I get it and all that, what are some real world use cases of this and the postgresql equivalent? Who's actually using these things for something other than saying how fast they are?<p>I just hope they aren't being used as public-facing JSON API endpoints and the such, since none of them seem to even consider the case of SQL injection. From a quick glance it doesn't seem that any type of parameterized query or prepared statements are available to even begin helping with that, and the "documentation" examples wouldn't be setting people off on the right foot by even limiting the location paths with strict regex's.
评论 #1449684 未加载
评论 #1449267 未加载
xhuang将近 15 年前
removing high level language in the middle is good, if you need performance, why not just use redis to server json directly, in the case you need scale up your db why not use crunchDB.
llimllib将近 15 年前
What is the code in this app written in, I don't really follow?
评论 #1449003 未加载
评论 #1448850 未加载
评论 #1448925 未加载
executive将近 15 年前
can this be used with PHP though?
评论 #1448915 未加载