I
I
Igor Belov2014-02-03 14:07:44
PHP
Igor Belov, 2014-02-03 14:07:44

Why does a PHP script slow down on the first run, but flies on subsequent runs?

There is the usual standard WordPress from the official box with the official theme, fresh and installed with no content. At the first visit, any page is generated in more than a second, on subsequent visits it takes 1/10 second and faster. It doesn't matter which page you go to. It is enough to go to any page, it will be generated in a second, and then also any page will be generated at least 10 times faster, and sometimes 20-30 times faster.
If then you do not enter for several hours, then again the same - first a long generation, then a fast one.
WordPress runs on a lightly loaded dedicated powerful server. Caching in WP did not set up any specially. On the server, the standard bundle is nginx + apache + php + mysql.
Is it possible that PHP caches the bytecode the first time it is generated and therefore subsequent runs are 10-20 times faster? Is this situation normal? Could this be due to some server software settings?
Here is the patient: wordpress-test.eurodir.ru/wordpress
Here is his PHPinfo: wordpress-test.eurodir.ru/phpinfo.php

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikolai Vasilchuk, 2014-02-03
@ibelov

First, you have APC installed.
Secondly, wordpress still caches data out of the box.

K
kompi, 2014-02-03
@kompi

The cache goes out, set the lifetime longer.

A
Alexander, 2014-02-03
@kryoz

There are two options. Either you overloaded the site with some plugins that generate a huge bunch of queries in the database, or brake hosting. Caching helps somewhat, but it's like a cure for the symptoms, not the disease.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question