Answer the question
In order to leave comments, you need to log in
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
Yes, it is needed, because then you will have to read not from the "slow" database, but from the "fast" cache.
The losses are the same over time.
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 questionAsk a Question
731 491 924 answers to any question