How to gradually implement and test memcached on an existing site?

I do not mean the actual installation. I am currently using LAMP for development and would like to start using memcached for a high traffic site. What types of db calls should be cached? (everything?) and what is a good way to test the load on the development server? Are there any benchmarks that I should first look at my production facility? Basically, a site is selected with very few updates / inserts. Are there any general recommendations that should be followed regarding the use of a bar or traffic, or is it mostly just through trial and error?

Thanks.

+3
source share
4

i , . , , , . , , , . memcached, codeigniter.

, . , , , . - , .

+1

, . .

, , , , .

, .

+1

-, , , , .

db ? (?)

, , , , .

, , , , memcache.

/ .

?

, .

, ? /.

, , , , . .

, sql, .

- , , ?

, . , memcache.

+1

SELECT , MySQL .

, , :

> SHOW GLOBAL STATUS LIKE 'Qcache_hits';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| Qcache_hits   | 735740 |
+---------------+--------+
1 row in set (0.00 sec)


> SHOW GLOBAL STATUS LIKE 'Com_select';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Com_select    | 5644038 |
+---------------+---------+
1 row in set (0.00 sec)

Qcache_hits / (Qcache_hits + Com_select)

735740 / (735740 + 5644038) = 0.1153

, 11% .

% , memcached.

MySQL ( , ). , ( , ), . , memcached , , MySQL.

. , (!)

, , :

> SHOW GLOBAL VARIABLES LIKE '%cache';

have_query_cache = YES query_cache_size > 0 .

+1

Source: https://habr.com/ru/post/1706850/


All Articles