Currently the "dcp" and "dcpagg" stats are collated by the front-end thread. This can be an expensive operation, and hence the STAT command can take a significant time to return. This means the STAT operation is tying-up a front-and thread which means that operations that happen to be allocated to the same thread get delayed for an unacceptable length of time.
- Move the expensive part(s) of these stat groups to a background task, allowing the client operation to EWOULDBLOCK and yield execution back to the front-end thread.
- Investigate what part(s) of these stat groups ns_server needs. If the stat(s) needed are cheap then consider new stat groups which only contain the specific elements ns_server needs.
Note we might want both of these; given that dcp and dcpagg are recorded by cbcollect_info and we wouldn't want to remove them there.