当今可扩展高性能 PHP 应用程序的最佳方法

发布于 2024-08-24 13:41:22 字数 317 浏览 7 评论 0原文

我们正处于新 PHP Web 应用程序的启动构建阶段,该应用程序将被放置在云服务器上,以便在客户数量增加或减少时快速轻松地扩展/缩小规模。最有可能的是,我们将使用 PHP 框架(Codeigniter)来保持较高的开发速度。

我们的下一步是实现提高性能的功能(缓存等)并选择要使用的数据库。

我们首先想到的当然是像 memcached 和 eaccelerator 这样的解决方案,但是现在还有更好的解决方案吗?

当关注高性能时,mySQL 真的是昨天的选择吗?

所以,请分享您关于如何为高性能网络应用程序创建基本基石的想法和想法!

谢谢!

We are in the startup build phase of a new PHP webapp that will be placed onto a cloud server to allow fast and easy up/downscaling when customers will grow or decrease in numbers. Most probably, we will use a PHP framework (Codeigniter) to keep development speed high.

Our next step is to implement features for increased performance (cacheing etc) and choosing which databases to use.

Solutions like memcached and eaccelerator is of course what comes up into our minds at first, but are there even better solutions available out there today?

Is mySQL really yesterdays choice when high performance is in focus?

So, please - share your ideas and thoughts on how to create the basic cornerstones for a high performance webapp!

Thanks!

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

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

发布评论

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

评论(2

谁人与我共长歌 2024-08-31 13:41:22

你应该知道两件事:

  1. 十分之八或九的初创公司都会失败; 。
  2. 每月独立访问量达到 1-500 万不需要任何特殊条件 如果当您达到 5+ 百万个独立用户时,您可能会重写您的应用程序 2-6 次。

所以在出现问题之前基本上不用担心这个“问题”。

此外,云服务器适合突发使用,但数据费用往往使它们成为持续使用的糟糕选择。典型的进展是:

  1. 共享托管(您可以跳过此);
  2. VPS(你也可以跳过这个);
  3. 专用服务器;然后是
  4. 协同定位。

至于使用什么工具,这完全取决于您的应用程序。对于大多数情况,MySQL 是一个不错的选择。像 APC 或 eAccelerator 这样的操作码缓存通常是一个好主意。 Memcache 对于某些类型的应用程序很有用。

Two things you should know:

  1. 8 or 9 out of 10 startups fail; and
  2. Nothing exceptional is required to get you to 1-5 million uniques a month. If and when you get to 5+ million uniques ou will probably have rewritten your application 2-6 times.

So basically don't worry about this "problem" until you have a problem.

Also cloud servers are good for burst usage but the data fees tend to make them a bad choice for constant usage. The typical progression is:

  1. Shared hosting (you may skip this);
  2. VPS (you might skip this too);
  3. Dedicated server; then
  4. Co-location.

As for what tools to use, well that depends entirely on your app. MySQL is a fine choice for most circumstances. An opcode cache like APC or eAccelerator is typically a good idea. Memcache can be useful for certain kinds of applications.

不知所踪 2024-08-31 13:41:22

我认为你应该专注于构建一个好的应用程序,一旦你拥有足够大的用户群,就应该担心性能问题。这并不是说您应该在编码时不考虑性能。然而,听起来您甚至在拥有任何真正用户之前就试图进行优化。您所做的任何性能调整都是理论上的,而不是基于特定应用程序实际发生的情况。您必须拥有大量用户,然后才能看到应用程序中特定的使用模式和瓶颈。另外,如果您真的非常担心这个级别的性能,那么使用 PHP 并不是最佳选择。 PHP 可以做得很快,但与其他编译语言相比,它总是会慢一些。没有答案。这完全取决于您的应用程序正在做什么。如果大部分服务器时间都花在数据库等其他地方,PHP 可以正常工作。 MySQL 可以很好地取决于您正在做什么以及您尝试使用它来获取什么类型的信息。

I think you should focus on building a good app, and worry about performance once you have a big enough user base that it matters. That isn't to say you should code without performance in mind. However it sounds like you're trying to optimize before you even have any real users. Any performance tuning you do would be theoretical, and not based on what actually happens with your particular application. You'll have to have a lot of users before you can see the usage patterns and the bottle necks that result specifically in your application. Also, if you're really worried that much about performance at this level, using PHP is not the way to go. PHP can be made fast, but compared to other languages which are compiled, it will always be slower. There is no answer. It all depends on what your application is doing. PHP can work fine if most of the server time is spent somewhere else like in the database. MySQL can be fine depending on what you're doing, and what kind of information you are trying to use it for.

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