Read "Daily request million-level QQ member AMS platform PHP7 upgrade Practice" blog Experience notes

Source: Internet
Author: User
Tags apc

Because the original article from the CSDN without permission cannot be reproduced, so only record the great God's experience and the most worthy of reference to the place, for future references, PHP7 version has not yet popularized, for the predecessors in order to improve the performance has the courage to explore the new technology dare to taste the spirit of crab is very much encouraged.

risks and challenges of PHP7 upgrades
for an already online large-scale public Web services, the basic public software upgrade, usually a thankless job, do well, not necessarily be perceived by everyone, but, upgrade out of the problem, you need to bear the heavier responsibility. To minimize the risk of escalation, we must first understand the challenges and risks of our upgrade.
Here are the list of upgrade challenges and risks that seniors have organized:
(1) Apache2.0 and PHP5.2 These two 2008-2009 years of basic software version is older, upgrade to Apache2.4 and PHP7, version upgrade span is relatively large, time span of 7-8 years, therefore, compatibility issues challenge is higher. In fact, our company's current web PHP services, many are stuck in PHP5.2 and PHP5.3 version, the version is low.
(2) AMS Extensive use of self-developed tphplib extension, Tphplib very early in the company has no one to maintain, this extension only PHP5.3 and PHP5.2 compiled so version, and, some extensions do not support thread safety. Thread safety is supported because our previous Apache used the prefork mode, And we want to be able to use Apache2.4 's event mode (2014, after prefork and workers, the introduction of multi-process thread management mode, to support high concurrency, better performance).
(3) The problem of grammatical compatibility, from PHP5.2 to PHP7 the span is too large, even if the official PHP is claimed to be 99% in terms of backward compatibility, but our code size is larger, it is still an unknown risk.
(4) The risk of new software, the basic software such as Apache and PHP to upgrade to the latest version, and these versions of some of the features may have unknown risks and defects.
Some students may suggest that the use of Nginx will be more excellent choice, indeed, simple comparison of Nginx and Apache in high concurrency performance, nginx performance is more excellent. But in terms of PHP CGI, NGINX+PHP-FTPM and apache+mod_php do not have a big gap. On the other hand, because of the long-term use of Apache, we have accumulated more knowledge and experience in technology, so it may not be the best choice, but, specifically to our business scenario, is a more appropriate choice.

upgrading from PHP5.2 to PHP5.6 is relatively easy, and the main tasks that seniors do are as follows:
(1) Cleaning up old extensions that are no longer used
(2) Resolve thread safety issues
(3) compiling APIs such as Cmem to a new version
(4) PHP code syntax is based on PHP5.6 compatibility (in fact not changing very much)
(5) part of the extended synchronization adjustment. The APC extension becomes Zend_opcache and APCU, and the previous APC is a feature that contains the compile cache and user memory operations, which are broken down into two separate extensions in PHP compared to the new version.

upgrading from PHP5.6 to PHP7.0 workload is more, and relatively complex, the following are the predecessors to develop each stage of the upgrade plan:
(1) Technical pre-research, PHP7 upgrade preparation.
(2) The environment compiles and builds, downloads the related compilation package, constructs the complete compilation environment and the test environment. (The compilation environment still needs to be more dependent so)
(3) compatible with upgrades and tests. PHP7 extended recompile and code compatibility work, AMS functional verification, performance pressure measurement.
(4) on-line grayscale. Package the installation package as PKG, write the relevant installation shell installation execution code (including soft links, resolve some so dependencies). Then, the grayscale installation to the current network, observation.
(5) Official release. Enlarge the grayscale range and upgrade the whole volume.

Read "Daily request million-level QQ member AMS platform PHP7 upgrade Practice" blog Experience notes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.