V
V
Victoria Erofeeva2020-06-17 09:53:27
1C-Bitrix
Victoria Erofeeva, 2020-06-17 09:53:27

How does Bitrix work with memcached?

Tell me if Bitrix works with memcached. PHP 7 is installed on our server. I
found this article https://blog.dh.md/2016/12/bitrix-php-memcached.html
It says that Bitrix does not support memcached and you need to install an additional library.

It turns out that in order for Bitrix to work with memcached, it is necessary to install an additional library in Bitrix, or was it like this before and now it is not required to install additional libraries?

The second question is can memcached really help to speed up the site? In our case, when testing the site speed, it is shown that the site is running slowly, the site speed is: Slow (1.59 sec.)
Here are the parameters for loading the site from different regions
5ee9bd33b17bf704697331.jpeg

Performance parameters
5ee9bd3e75fc9048554632.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Nikolaev, 2020-06-17
@gromdron

Tell me if Bitrix works with memcached.

Yes it works. But for the latest versions of Bitrix, it is recommended to use Redis.
https://dev.1c-bitrix.ru/learning/course/index.php...
The second question is can memcached really help to speed up the site?

Everything is relative. The memcached/redis cache is definitely faster than the file cache.
But your problem may not be caching at all.
For example, if no component stores data in the cache and constantly accesses the database, then changing the cache storage mechanism will not help. And if you allocate little RAM for the cache (by default, bitrix env goes like either 64MB or 1GB), and the cache is large, then it can also slow down the work.
Perhaps you have connection of external scripts or non-cached queries, or the layout of your site is too huge and the parsing itself takes a lot of time.

S
smilingcheater, 2020-06-17
@smilingcheater

I will answer in the reverse order - the speed tester checks not only the speed of rendering HTML by the backend (Bitrix), but also how quickly this HTML is displayed by the browser. If you have a fast back but a heavy front, memkesh won't help you. It is necessary to look at detailed statistics of what exactly slows down.
You write that you have PHP 7 installed - which one exactly - 7.0, 7.1, ..., 7.4?
And what is your web environment - shared hosting, vps/vds, BitrixVM?
In general, to make Bitrix work with memcache, you need to:
(I give all the commands for Debian / Ubuntu)
apt-get install -y memcached - put the memcache on the server
apt-get install -y php7.1-dev - install the dev package for your PHP version
pecl install memcache - install the memcache model for Bitrix via PECL, you
may need to install additional libraries, most often stumbles on zlib:
apt-get install -y zlib1g-dev
then add the library connection to php.ini:
extension=memcache.so
and restart the web server
After that, write in the Bitrix config (file /bitrix/.settings.php)

'cache' => array(
        'value' => array (
            'type' => 'memcache',
            'memcache' => array(
                'host' => '127.0.0.1',
                'port' => '11211'
            ),
            'sid' => $_SERVER["DOCUMENT_ROOT"]."#01"
         ),
    ),

(replacing the current 'cache' block)

V
Viktor Taran, 2020-06-18
@shambler81


memcached does not work at all
+ allows you to work over the network
+ you can store sessions in a cluster of machines
- slow because it works over the network
- Slow even through a socket (faster than without a cache, of course)

opcache

+ the fastest cache
+ the most standard one goes to the Bitrix VM
-cannot work over the network, if you have a cluster, you will not be able to store sessions in it, otherwise it will disappear when the client changes upstream.
I think you will draw your own conclusion.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question