More reasonable size for metadata

This commit is contained in:
Erik Zandvliet 2016-05-19 17:32:40 +02:00
parent abbc2e7e1f
commit 5c4e0d8c54
6 changed files with 9 additions and 6 deletions

View file

@ -74,6 +74,9 @@ static const char * DBG_LVL_LIST[] = {"NONE", "FAIL", "ERROR", "WARN", "INFO", "
/// The size used for stream header pages under Windows, where they cannot be size-detected. /// The size used for stream header pages under Windows, where they cannot be size-detected.
#define DEFAULT_META_PAGE_SIZE 16 * 1024 * 1024 #define DEFAULT_META_PAGE_SIZE 16 * 1024 * 1024
/// The size used for stream header pages under Windows, where they cannot be size-detected.
#define DEFAULT_STRM_PAGE_SIZE 4 * 1024 * 1024
/// The size used for stream data pages under Windows, where they cannot be size-detected. /// The size used for stream data pages under Windows, where they cannot be size-detected.
#define DEFAULT_DATA_PAGE_SIZE SHM_DATASIZE * 1024 * 1024 #define DEFAULT_DATA_PAGE_SIZE SHM_DATASIZE * 1024 * 1024

View file

@ -872,7 +872,7 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
char pageId[NAME_BUFFER_SIZE]; char pageId[NAME_BUFFER_SIZE];
IPC::sharedPage streamIndex; IPC::sharedPage streamIndex;
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, it->c_str()); snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, it->c_str());
streamIndex.init(pageId, DEFAULT_META_PAGE_SIZE, false, false); streamIndex.init(pageId, DEFAULT_STRM_PAGE_SIZE, false, false);
if (streamIndex.mapped){ if (streamIndex.mapped){
static char liveSemName[NAME_BUFFER_SIZE]; static char liveSemName[NAME_BUFFER_SIZE];
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, it->c_str()); snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, it->c_str());

View file

@ -199,7 +199,7 @@ namespace Mist {
}{ }{
//Delete the stream index metapage. //Delete the stream index metapage.
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
IPC::sharedPage erasePage(pageName, 1024, false, false); IPC::sharedPage erasePage(pageName, DEFAULT_STRM_PAGE_SIZE, false, false);
erasePage.master = true; erasePage.master = true;
} }
//Delete most if not all temporary track metadata pages. //Delete most if not all temporary track metadata pages.
@ -296,7 +296,7 @@ namespace Mist {
if (!nProxy.metaPages.count(0) || !nProxy.metaPages[0].mapped) { if (!nProxy.metaPages.count(0) || !nProxy.metaPages[0].mapped) {
char pageName[NAME_BUFFER_SIZE]; char pageName[NAME_BUFFER_SIZE];
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
nProxy.metaPages[0].init(pageName, DEFAULT_META_PAGE_SIZE, true); nProxy.metaPages[0].init(pageName, DEFAULT_STRM_PAGE_SIZE, true);
nProxy.metaPages[0].master = false; nProxy.metaPages[0].master = false;
} }
myMeta.writeTo(nProxy.metaPages[0].mapped); myMeta.writeTo(nProxy.metaPages[0].mapped);

View file

@ -16,7 +16,7 @@ namespace Mist {
//Open the page for the metadata //Open the page for the metadata
char pageName[NAME_BUFFER_SIZE]; char pageName[NAME_BUFFER_SIZE];
snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); snprintf(pageName, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
nProxy.metaPages[0].init(pageName, myMeta.getSendLen(), true); nProxy.metaPages[0].init(pageName, DEFAULT_STRM_PAGE_SIZE, true);
//Make sure we don't delete it on accident //Make sure we don't delete it on accident
nProxy.metaPages[0].master = false; nProxy.metaPages[0].master = false;

View file

@ -220,7 +220,7 @@ namespace Mist {
char pageId[NAME_BUFFER_SIZE]; char pageId[NAME_BUFFER_SIZE];
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
nProxy.metaPages.clear(); nProxy.metaPages.clear();
nProxy.metaPages[0].init(pageId, DEFAULT_META_PAGE_SIZE); nProxy.metaPages[0].init(pageId, DEFAULT_STRM_PAGE_SIZE);
if (!nProxy.metaPages[0].mapped){ if (!nProxy.metaPages[0].mapped){
FAIL_MSG("Could not connect to server for %s", streamName.c_str()); FAIL_MSG("Could not connect to server for %s", streamName.c_str());
onFail(); onFail();

View file

@ -362,7 +362,7 @@ namespace Mist {
if (Util::startInput(streamName)){ if (Util::startInput(streamName)){
char pageId[NAME_BUFFER_SIZE]; char pageId[NAME_BUFFER_SIZE];
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str()); snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
streamIndex.init(pageId, DEFAULT_META_PAGE_SIZE); streamIndex.init(pageId, DEFAULT_STRM_PAGE_SIZE);
if (streamIndex.mapped){ if (streamIndex.mapped){
metaLock = true; metaLock = true;
metaLocker.wait(); metaLocker.wait();