nikita2206
nikita2206

Reputation: 1188

Does php-memcached have any local caching buffer?

Our lead developer claims that memcached owns some local caching buffer. So he is doing some actions in code, that would lead to hundreds-thousands of calls to memcached with almost everytime the same keys. It would definetly lead to many memory allocations, but would it require network overhead?

I did try to read the source code of php-memcached, but it just calls libmemcached's function (I don't remember its name) and I couldn't figure out where can I find its definition.

Upvotes: 2

Views: 395

Answers (1)

Ja͢ck
Ja͢ck

Reputation: 173532

How exactly your lead developer managed to extract that information would have been useful. From the list of constants, this particular option sticks out:

Memcached::OPT_BUFFER_WRITES

It's used to buffer writes to Memcached to reduce network overheads; however, it also states that a read operation immediately flushes that buffer to the server.

Web searches so far didn't provide any information to either substantiate or contradict the statement, though if there was such a feature there should be an option to switch off that behaviour; the absence of which leads me to believe that it's not there.

Upvotes: 4

Related Questions