S
S
sandrain2013-12-07 16:03:00
PHP
sandrain, 2013-12-07 16:03:00

How to solve the problem of accesses to memcache in one unit of time (multithreading)?

Hello.
How to solve the problem of accesses to memcache in one unit of time (multithreading).
The essence of the problem is the so-called dog-pile effect (cache decay).
There is a variant based on CAS
php.net/manual/ru/memcached.cas.php
In short: the data is locked, then updated and the lock is removed, at the time of the lock, the rest of the threads are waiting.
Is memcached generally needed in multithreading with such losses of time? Maybe just write to the database? The losses are the same over time.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav, 2013-12-07
@korchasa

Yes, it is needed, because then you will have to read not from the "slow" database, but from the "fast" cache.

A
Alexey Sundukov, 2013-12-07
@alekciy

The losses are the same over time.

Yah? And the men don’t even know ... different memcacheds are used ...

V
Vitaly Zheltyakov, 2013-12-07
@VitaZheltyakov

First, what kind of data is stored in the cache? If the data has a simple structure, then it is better to use files.
Secondly, if there is a problem of concurrent access to the cache, then why is it needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question