I have a problem indeed: everything works perfectly as you said if I input the eviction command in Python interactive mode, leading to this output on the Python console
>>> cb = CbClient("http://localhost:8091/pools/default","default","",False)
>>> fakeDoc =
>>> fakeDocKey = "dummy"
>>> fakeDocStatus = cb.set(fakeDocKey, 0, 0, json.dumps(fakeDoc))
>>> memcached = cb.memcached(fakeDocKey)
(3979266754, 0, 'Ejected.')
and increasing the "vb_active_num_non_resident" by one.
When instead I run a non interactive code doing the same thing (1 set and 1 eviction) I get almost random behavior:
usually the "vb_active_num_non_resident" is unchanged, sometimes it gets changed in a very large number (seems like an overflow or something).
If i run a whole loop with some hundreds of insertions and evictions I get the same result as with just 1 set and 1 eviction.
FYI I'm running couchbase on a single machine, OS: x86_64-unknown-linux-gnu Version: 2.0.0 community edition (build-722-rel) on Ubuntu 12.04.
PS. While doing these tests I repeatedly flushed and/or deleted and recreated the bucket, and I used this command:
watch -d "/opt/couchbase/bin/cbstats localhost:11210 all | grep vb_active"
to monitor the parameters.
I believe that the tests led the couchbase in an inconsistent state, because now it's repeatedly restarting, with this message on the web-UI: "Difficulties communicating with the cluster; displaying cached information!".
Restarting the linux service doesn't help, I think I'll reinstall it.