Table of Contents
回复内容:
Home Backend Development PHP Tutorial 用 ThinkPHP 这样的框架开发门户网站,有什么缺点?

用 ThinkPHP 这样的框架开发门户网站,有什么缺点?

Jun 06, 2016 pm 04:43 PM
thinkphp

相比自己纯源开发来说,用thinkphp肯定开发速度会快些但对于长期运行,以后可能会有很大访问量的门户网站来说,用thinkphp框架会有什么缺点吗,比如执行速度,负载等方面

回复内容:

就php框架本身来说

国内使用情况
thinkphp可以说是国产最热框架,各大公司都在用,更别提个人了.
我知道的金山,腾讯,dnspod都在用,我也在用.
原则就是团队对什么技术掌握的最多,就用什么技术,换成框架来说就是团队对某个框架最熟悉,那么就用这个最熟悉的框架

框架对比
php的框架五花八门,重型的zf,symfony2,流行的ci,yii,Larave
高性能版的C语言写的php扩展.国外Phalcon,国内鸟哥的 Yaf,也是微博使用的
这里未列出的还有好多好多.还有很多高手自己维护自己的"框架"
这些个框架国内都有人使用. 至于选什么框架,完全看自己技术团队的技术实力,以及评比结果那个更适合自己.

用php的网站来说
性能再差的php框架可以用系统构架来做。高并发的网站不是一台机器来抗.
多机php负载均衡.
先抗住再优化.
好多公司都几十上百台了php才来做大规模的调优,对非常消耗cpu的地方来重点优化,和重构,或者其他语言重构. 当然优化也是从编码 到上线 监控日志. 优化是长期不断的过程.也不紧紧是一次大规模重构.
抽离静态资源. 会话session,可以放在redis memcache中去.
数据库读写分离. 读多机群集.
上redis 等NoSql把热数据堆这里来.
启用cdn系统加快静态文件分发. 小规模三方,大规模自建.

用thinkphp一样可以高并发,就是看你怎么做构架了.

以上简单一说.

总之就是
系统瓶颈不在语言或框架上,而是在构架上.
好的构架不就是堆机器么. 看人了。还是应该先开发出来。开发时获取数据这一块注意不要跟数据库强耦合,不要不加处理直接使用以数据库的字段为key的数组。因为以后有量时十有八九要分表、加缓存、换 NoSQL 等等。 TP是一个很好的框架,我们已经有很多这样的成功产品,等你的网站流量很大的时候就不是框架以前哦去解决的问题了 php的速度瓶颈绝对不是在执行上面,不然他也不会成为一种不用编译,而是每访问一次编译一次的语言,php优点就是执行特别快,这个和框架无关,我觉得php的速度瓶颈在数据库,如何更加高效的存储和读取,以及分类数据,是更重要的。所以数据库的设计要好好研究一下,当然,还有上面说的,各种缓存技术,无论是转静态也好,还是服务员缓存技术也好,都是不错的方法! 这一块看构架。有一些问题需要优化,例如本地写的的问题。

例如,超大访问量对于nosql的考虑,队列的考虑,分库分表的考虑。

这是程序方面。

构架方面自己需要分情况去看 如何tp不能再用了,说明 你们的钱也有了。 TP的响应速度相比其他的要慢很多,开发速度上,比其他的上手快很多,看自己的项目了。不过TP是开源的,有些东西可以自己把控。 如果单纯从业务来看,门户网站的业务逻辑足够简单,TP可以完全胜任。如果说关于这个性能啥的,我还真的不认为TP会成为性能的牺牲者。哪有门户网站不做缓存的,都缓存了,框架性能就不是第一要素了。
而且,基本上也不可能单纯用PHP来完成一个门户,还有更多,比如sync,C扩展、数据库同步等等。 会有很大负载的网站,前台根本就不能用tp,任何框架都不可以。 框架带来开发便捷的同时,会有性能损耗。 建议使用开源CMS,部分模块二开。完全用TP来做,周期长,易用性低。架构做得好,执行速度和负载没问题。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1252
24
How to run thinkphp project How to run thinkphp project Apr 09, 2024 pm 05:33 PM

To run the ThinkPHP project, you need to: install Composer; use Composer to create the project; enter the project directory and execute php bin/console serve; visit http://localhost:8000 to view the welcome page.

There are several versions of thinkphp There are several versions of thinkphp Apr 09, 2024 pm 06:09 PM

ThinkPHP has multiple versions designed for different PHP versions. Major versions include 3.2, 5.0, 5.1, and 6.0, while minor versions are used to fix bugs and provide new features. The latest stable version is ThinkPHP 6.0.16. When choosing a version, consider the PHP version, feature requirements, and community support. It is recommended to use the latest stable version for best performance and support.

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Which one is better, laravel or thinkphp? Which one is better, laravel or thinkphp? Apr 09, 2024 pm 03:18 PM

Performance comparison of Laravel and ThinkPHP frameworks: ThinkPHP generally performs better than Laravel, focusing on optimization and caching. Laravel performs well, but for complex applications, ThinkPHP may be a better fit.

Development suggestions: How to use the ThinkPHP framework to implement asynchronous tasks Development suggestions: How to use the ThinkPHP framework to implement asynchronous tasks Nov 22, 2023 pm 12:01 PM

"Development Suggestions: How to Use the ThinkPHP Framework to Implement Asynchronous Tasks" With the rapid development of Internet technology, Web applications have increasingly higher requirements for handling a large number of concurrent requests and complex business logic. In order to improve system performance and user experience, developers often consider using asynchronous tasks to perform some time-consuming operations, such as sending emails, processing file uploads, generating reports, etc. In the field of PHP, the ThinkPHP framework, as a popular development framework, provides some convenient ways to implement asynchronous tasks.

How to install thinkphp How to install thinkphp Apr 09, 2024 pm 05:42 PM

ThinkPHP installation steps: Prepare PHP, Composer, and MySQL environments. Create projects using Composer. Install the ThinkPHP framework and dependencies. Configure database connection. Generate application code. Launch the application and visit http://localhost:8000.

How is the performance of thinkphp? How is the performance of thinkphp? Apr 09, 2024 pm 05:24 PM

ThinkPHP is a high-performance PHP framework with advantages such as caching mechanism, code optimization, parallel processing and database optimization. Official performance tests show that it can handle more than 10,000 requests per second and is widely used in large-scale websites and enterprise systems such as JD.com and Ctrip in actual applications.

Development suggestions: How to use the ThinkPHP framework for API development Development suggestions: How to use the ThinkPHP framework for API development Nov 22, 2023 pm 05:18 PM

Development suggestions: How to use the ThinkPHP framework for API development. With the continuous development of the Internet, the importance of API (Application Programming Interface) has become increasingly prominent. API is a bridge for communication between different applications. It can realize data sharing, function calling and other operations, and provides developers with a relatively simple and fast development method. As an excellent PHP development framework, the ThinkPHP framework is efficient, scalable and easy to use.

See all articles