Performance improvement of WordPress by accelerating PHP

apcu





As mentioned by this tweet, I am interested in accelerating web service.

 

In this article I have done accelerating PHP which is scripting engine of WordPress.
I performed benchmark before and after.

You can see where it is.





Other improvements are in this article.

How to accelerate WordPress
In this article let me summarize how to accelerate WordPress. System architecture You can find from my github. Nginx Tar...

What I did

I introduced opcache/apcu.

This is easy to introduce because I run php-fpm on docker-compose.
I picked up corresponding parts of RUN.

FROM    php:fpm-buster

RUN     docker-php-ext-install opcache bcmath && \
        pecl install apcu && \
        echo "extension=apcu.so" > $PHP_INI_DIR/conf.d/apcu.ini && \
        cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini



You need to restart or reload php-fpm.
– To reload you can kill -SIGUSR2 <process id of php-fpm>

I confirmed by phpinfo()

opcache is OK.



apcu is also good.

Before vs after

I use this article image which runs on Raspberry Pi 4 as “Before”.



I measured with below condition.

- Using LightHouse in Developers Tools of Chrome browser.
  Checking Performance only
- Taking median as representative(n = 5).
- Measuring on secret tab of Chrome.


Before
<—Mobile Desktop—>

 After
<—Mobile Desktop—>





Mobile improved 5 points, Desktop did 9 points!
Mobile is over 150% better than before!

Conclusion

How was it?

Yes, you can do it!

Are you interested in this kind of topic?
Yes, you can refer Nginx improvement by this article!

Performance improvement of WordPress by accelerating Nginx
As mentioned by this tweet, I am interested in accelerating web service. In this article I accelerated Nginx which is se...

Comments

Copied title and URL