sphinx索引中关于indexer里的mem_limit配置项的大小限制

今天在进行sphinx索引的时候遇到报错:WARNING: collect_hits: mem_limit=-2097152 kb too low, increasing to -118752 kb,排查后发现是mem_limit配置项的问题,indexer索引中的配置项mem_limit是建立索引时的索引内存限制值,此值并不是越大越好,今天在修改配置的时候,考虑到服务器内存足够大,我就把这个配置改成了2G即2048M,然后在索引的时候就碰到了下面的报错,详细如下:
[kermit@kermit sphinxdata]$ sudo bin/indexer -c /usr/local/coreseek4.1/etc/test.conf base
Coreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]
Copyright © 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)
using config file ‘/usr/local/coreseek4.1/etc/test.conf’…
indexing index ‘base’…
WARNING: collect_hits: mem_limit=-2097152 kb too low, increasing to -118752 kb
*** Oops, indexer crashed! Please send the following report to developers.
Sphinx 2.0.2-dev (r2922)
-------------- report begins here ---------------
Current document: docid=14844312, hits=0
Current batch: minid=0, maxid=0
Hit pool start: docid=0, hit=0
-------------- backtrace begins here ---------------
Program compiled with gcc 4.4.7
Host OS is Linux BFG-OSER-4435 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Stack bottom = 0x0, thread stack size = 0x14000
begin of system backtrace:
begin of system symbols:
bin/indexer(_Z12sphBacktraceib+0x95)[0x521045]
bin/indexer(_Z7sigsegvi+0xbe)[0x45cdfe]
/lib64/libpthread.so.0[0x317000f7e0]
bin/indexer(_ZN13CSphIndex_VLN5BuildERK10CSphVectorIP10CSphSource16CSphVectorPolicyIS2_EEii+0x33f9)[0x4aea19]
bin/indexer(_Z7DoIndexRK17CSphConfigSectionPKcRK17SmallStringHash_TIS_EbP8_IO_FILE+0x1fb6)[0x464e66]
bin/indexer(main+0x21fe)[0x46733e]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x316fc1ed1d]
bin/indexer[0x45c5a9]
Backtrace looks OK. Now you have to do following steps:

  1. Run the command over the crashed binary (for example, ‘indexer’):
    nm -n indexer > indexer.sym
  2. Attach the binary, generated .sym and the text of backtrace (see above) to the bug report.
    Also you can read the section about resolving backtraces in the documentation.
    -------------- backtrace ends here ---------------#以下为sphinx的.conf配置文件里的indexer配置。
    indexer
    {
    mem_limit = 2048M #一般来讲这个配置256M到1024M即可,
    } 从报错中可以看到mem_limit=-2097152 kb too low,此值2097152即是2048M。但是配置文件认为这个配置too low,可见这个配置sphinx不认可。官方文档中找到这么一段话,原文和译文如下:
    mem_limit-----------------
    Indexing RAM usage limit. Optional, default is 32M.Enforced memory usage limit that the indexer will not go above. Can bespecified in bytes, or kilobytes (using K postfix), or megabytes (usingM postfix); see the example. This limit will be automatically raised if setto extremely low value causing I/O buffers to be less than 8 KB; the exactlower bound for that depends on the indexed data size. If the buffers areless than 256 KB, a warning will be produced.Maximum possible limit is 2047M. Too low values can hurt indexing speed,but 256M to 1024M should be enough for most if not all datasets. Settingthis value too high can cause SQL server timeouts. During the documentcollection phase, there will be periods when the memory buffer is partiallysorted and no communication with the database is performed; and thedatabase server can timeout. You can resolve that either by raisingtimeouts on SQL server side or by lowering mem_limit.Example:| mem_limit = 256M| # mem_limit = 262144K # same, but in KB| # mem_limit = 268435456 # same, but in bytes. 索引RAM使用限制。可选的,默认32M。强制内存使用限制后索引器不会超出。可以以字节或千字节(使用K postfix)或兆字节(使用M postfix)这些单位指定这个配置; 看到这个例子。如果设置为非常低的值导致I/O缓冲区小于8KB,则会自动提高此限制; 确切地说,这取决于索引的数据大小。如果缓冲区不超过256KB,将会产生警告。最大可能的限制是2047M。值太低会伤害索引速度,但如果不是全部数据集,256M到1024M就足够了。将此值设置得过高可能会导致SQL Server超时。在文档收集阶段,会有一段时间内存缓冲区被部分分配,并且不会与数据库进行通信。数据库服务器可能超时。你可以通过在SQL服务器端调高时间或者通过降低mem_limit来解决这个问题mem_limit = 256M | #mem_limit = 262144K#相同,但以KB |为单位#mem_limit = 268435456#相同,但单位是字节
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值