当今可扩展高性能 PHP 应用程序的最佳方法
我们正处于新 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你应该知道两件事:
所以在出现问题之前基本上不用担心这个“问题”。
此外,云服务器适合突发使用,但数据费用往往使它们成为持续使用的糟糕选择。典型的进展是:
至于使用什么工具,这完全取决于您的应用程序。对于大多数情况,MySQL 是一个不错的选择。像 APC 或 eAccelerator 这样的操作码缓存通常是一个好主意。 Memcache 对于某些类型的应用程序很有用。
Two things you should know:
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:
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.
我认为你应该专注于构建一个好的应用程序,一旦你拥有足够大的用户群,就应该担心性能问题。这并不是说您应该在编码时不考虑性能。然而,听起来您甚至在拥有任何真正用户之前就试图进行优化。您所做的任何性能调整都是理论上的,而不是基于特定应用程序实际发生的情况。您必须拥有大量用户,然后才能看到应用程序中特定的使用模式和瓶颈。另外,如果您真的非常担心这个级别的性能,那么使用 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.