How to change "max_kv_size_per_doc" and make it work?

Hi

I need to change this parameter. Default is 1048576 bytes. I want at least 2097152 bytes.
I already know this is not recommended for a production environment as I have already read in this forum.

I’m using Couchbase 4.5 with Docker.

I already changed the file “opt/couchbase/etc/couchdb/default.ini” and restarted the container and later the service inside the container. But it doesn’t take effect.

I also tried this:
curl -X POST http://Administrator:password@localhost:8091/diag/eval -d ‘rpc:eval_everywhere(erlang, apply, [fun() -> couch_config:set(“mapreduce”, “max_kv_size_per_doc”, “2097152”) end, []]).’

But with no success.

Any help would be appreciated.

Regards,
Angelo

1 Like

During my tests, I changed the file “opt/couchbase/etc/couchdb/default.ini” again to set a new value for the parameter “function_timeout” and it worked. I tested with a sleep inside map function and the log showed timeout error.

It means that when I restart Couchbase it takes the new configuration.
But change the parameter “max_kv_size_per_doc” makes no difference. Does anyone know why?

Did you rebuild your indexes? The change to the value does not cause a reindex so you may need to drop and republish the view to production.
thanks
-cihan

Thanks for your answer Cihan.

Yes, I rebuilt the indexes and the log showed the same error again.
“too much data emitted: 1048652 bytes”

Do you know what’s wrong?

It’s an internal setting that shouldn’t be changed, hence it’s not possible.

If you emit so much, it’s likely that you should model your data differently, so that you don’t hit this issue.

Cheers,
Volker