About Yii's method to improve the performance optimization of concurrent numbers

不言
Release: 2023-04-02 22:34:02
original
2595 people have browsed it

This article mainly introduces the performance optimization method of Yii to improve the number of concurrency. It has a certain reference value. Now I share it with you. Friends in need can refer to it

  1. Turn on YII's APC cache

  • Add under the config/main.php components component:

     'apccache'=>array(
                'class'=>'system.caching.CApcCache'
          ),
    Copy after login
  • Download php_apc.dll, file Put it under php/ext, it may be more troublesome to search....

  • Add the php_apc extension in php.ini:

     extension=php_apc.dll
     apc.rfc1867 = on
     capc.max_file_size = 100M
     upload_max_filesize = 100M
     post_max_size = 100M
    Copy after login

    Restart apache, use Function info(), check whether there is apc extension.

  • Usage:

        Yii::app()->apccache->get(id);
        Yii::app()->apccache->set(id,value,time);
    Copy after login

2. Use yiilite.php
Import yii.php into the entry file index.php , change to introduce yiilite.php

run();
Copy after login

Note:

  • Open apc cache and then introduce yiilite.php, because there are some classes in this file that are not currently used will also be loaded in.

  • If apc cache is not turned on, website performance will be reduced.

The above is the entire content of this article. I hope it will be helpful to everyone’s study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

yii2’s preventive measures against csrf attacks

The above is the detailed content of About Yii's method to improve the performance optimization of concurrent numbers. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
yii
source:php.cn
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 [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!