Created
April 4, 2014 18:55
-
-
Save jzawodn/9980983 to your computer and use it in GitHub Desktop.
A simple patch to add rt_mem_limit to SHOW INDEX xxx STATUS in sphinx searchd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macbook :: ~/code/sphinxsearch-read-only » svn diff | |
Index: src/searchd.cpp | |
=================================================================== | |
--- src/searchd.cpp (revision 4648) | |
+++ src/searchd.cpp (working copy) | |
@@ -17303,6 +17303,7 @@ | |
{ | |
tOut.DataTuplet ( "ram_chunk", tStatus.m_iRamChunkSize ); | |
tOut.DataTuplet ( "disk_chunks", tStatus.m_iNumChunks ); | |
+ tOut.DataTuplet ( "mem_limit", tStatus.m_iMemLimit ); | |
} | |
pServed->Unlock(); | |
Index: src/sphinx.h | |
=================================================================== | |
--- src/sphinx.h (revision 4648) | |
+++ src/sphinx.h (working copy) | |
@@ -3173,12 +3173,14 @@ | |
int64_t m_iDiskUse; | |
int64_t m_iRamChunkSize; // not used for plain | |
int m_iNumChunks; // not used for plain | |
+ int64_t m_iMemLimit ; // not used for plain | |
CSphIndexStatus() | |
: m_iRamUse(0) | |
, m_iDiskUse(0) | |
, m_iRamChunkSize(0) | |
, m_iNumChunks(0) | |
+ , m_iMemLimit(0) | |
{} | |
}; | |
Index: src/sphinxrt.cpp | |
=================================================================== | |
--- src/sphinxrt.cpp (revision 4648) | |
+++ src/sphinxrt.cpp (working copy) | |
@@ -8603,6 +8603,8 @@ | |
} | |
pRes->m_iNumChunks = m_dDiskChunks.GetLength(); | |
+ //pRes->m_iMemLimit = 1024*1024*4096; // TODO: jz fix | |
+ pRes->m_iMemLimit = m_iSoftRamLimit; | |
Verify ( m_tChunkLock.Unlock() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment