ouchdb视图os_process_error-大文档 [英] couchdb views os_process_error - big documents

查看:116
本文介绍了ouchdb视图os_process_error-大文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,我们正在填写其中的文件,其中一些文件大小为10 KB,其中一些文件大小约为70 MB.

I have a database that we're filling up with documents, some of which are 10 KB, and some of which that are ~70 MB in size.

任何试图加载这些大文档的视图都会失败,并显示以下错误: {"error":"os_process_error","reason":"{exit_status,0}"} ,即使是以下基本视图:

Any view that tries to load these large documents fails with error: {"error":"os_process_error","reason":"{exit_status,0}"}, even this elementary one:

function(doc) {
    emit(null, "test");
}

os_process_error 设置为35000,但调用视图会在约15秒内死亡:

os_process_error is set to 35000, but calling the view dies in ~15 seconds:

time curl -X GET http://localhost:5984/portal_production/_design/all_data_keys/_view/view1
{"error":"os_process_error","reason":"{exit_status,0}"}

real    0m15.907s
user    0m0.016s
sys 0m0.000s

从其他一些线程来看,这似乎与堆栈大小有关: couchdb问题线程.尽管找不到该方法的值的引用,但我已经应用了此补丁以增加堆栈大小.所以我在黑暗中射击.

From a few other threads, seems like this is related stack size: couchdb issue thread. I've applied this patch to increase the stack size, although I couldn't find a reference to the method's value. So I'm shooting in the dark a bit.

Soooo ....真正的问题是:在大型文档上使用视图的正确方法是什么?我确定我不是第一个遇到此问题的人.

Soooo.... the real question is: what is the correct approach for using views on large documents? I'm sure I'm not the first to have this problem.

推荐答案

您将达到couchjs堆栈大小限制.如果您使用的是CouchDB 1.4.0+,则默认情况下,其大小受64 MiB限制.您可以通过在CouchDB配置中为JavaScript查询服务器指定-S <number-of-bytes>选项来增加它.例如,要将堆栈大小设置为128 MiB,您的配置值将如下所示:

You'd hit couchjs stack size limit. If you're using CouchDB 1.4.0+ his size is limited by 64 MiB by default. You may increase it by specifying -S <number-of-bytes> option for JavaScript query server in CouchDB config. For instance, to set stack size to 128 MiB your config value will looks like:

[query_servers]
javascript = /usr/bin/couchjs -S 134217728 /usr/share/couchdb/server/main.js

请注意,根据您的操作系统,/usr/bin/couchjs可能对您有所不同.添加此更改后,您需要重新启动CouchDB.

Note, that /usr/bin/couchjs may be different for you depending on your OS. After adding this changes you need to restart CouchDB.

如果您尝试通过HTTP API更新JavaScript查询服务器配置,请确保从外壳kill所有couchjs进程允许它们应用更改.

If you'll try to update JavaScript query server config though HTTP API, make sure to kill all couchjs processes from shell to let them apply changes.

如果您的CouchDB版本是< 1.4,请尝试首先升级.

If your CouchDB version is <1.4 try to upgrade first.

这篇关于ouchdb视图os_process_error-大文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆