Changeset 5779


Ignore:
Timestamp:
May 11, 2011 11:20:58 PM (5 years ago)
Author:
hubu
Message:

Fix Ticket: https://trac.osgeo.org/mapguide/ticket/1687
Reviewed by Bruce Dechant.

Location:
trunk/MgDev/Server/src/Services/Resource
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MgDev/Server/src/Services/Resource/DbEnvironment.cpp

    r5527 r5779  
    4343#endif
    4444
    45     m_dbEnv.set_cachesize(0, MG_CACHE_SIZE, 1);
    46     m_dbEnv.set_lg_bsize(MG_LOG_BUF_SIZE);
     45    // Set the cache size based on the repository type
     46    if(MgRepositoryType::Session == repositoryType)
     47    {
     48        // Session repository
     49        m_dbEnv.set_cachesize(0, MG_SESSION_CACHE_SIZE, 1);
     50        m_dbEnv.set_lg_bsize(MG_SESSION_LOG_BUF_SIZE);
     51    }
     52    else
     53    {
     54        // Library repository
     55        m_dbEnv.set_cachesize(0, MG_LIBRARY_CACHE_SIZE, 1);
     56        m_dbEnv.set_lg_bsize(MG_LIBRARY_LOG_BUF_SIZE);
     57    }
     58
    4759    m_dbEnv.set_timeout(MG_DB_ENV_TIMEOUT, DB_SET_LOCK_TIMEOUT);
    4860    m_dbEnv.set_timeout(MG_DB_ENV_TIMEOUT, DB_SET_TXN_TIMEOUT);
    4961    m_dbEnv.set_tx_max(MG_MAX_TRANSACTIONS);
    50     m_dbEnv.set_tx_max(40); // Set maximum number of allowed transactions. Default is 20
    5162
    5263    u_int32_t containerFlags = DB_CREATE|DB_THREAD|DBXML_NO_INDEX_NODES;
  • trunk/MgDev/Server/src/Services/Resource/DbEnvironment.h

    r5527 r5779  
    2323// All sizes must be in powers-of-two.
    2424// TODO: Determine the best sizes to improve the Server performance.
    25 static const u_int32_t MG_KB                = 1024;
    26 static const u_int32_t MG_MB                = 1048576; // 1024^2
    27 static const u_int32_t MG_CACHE_SIZE        = 32 * MG_MB;
    28 static const u_int32_t MG_DB_PAGE_SIZE      = 32 * MG_KB;
    29 static const u_int32_t MG_DBXML_PAGE_SIZE   = 32 * MG_KB;
    30 static const u_int32_t MG_LOG_BUF_SIZE      = 12 * MG_MB;
    31 static const u_int32_t MG_MAX_TRANSACTIONS  = 1000;
    32 static const u_int32_t MG_SESS_DB_PAGE_SIZE = 2 * MG_KB;
     25static const u_int32_t MG_KB                   = 1024;
     26static const u_int32_t MG_MB                   = 1048576; // 1024^2
     27static const u_int32_t MG_LIBRARY_CACHE_SIZE   = 32 * MG_MB;
     28static const u_int32_t MG_SESSION_CACHE_SIZE   = 2 * MG_MB;
     29static const u_int32_t MG_DB_PAGE_SIZE         = 32 * MG_KB;
     30static const u_int32_t MG_DBXML_PAGE_SIZE      = 32 * MG_KB;
     31static const u_int32_t MG_LIBRARY_LOG_BUF_SIZE = 12 * MG_MB;
     32static const u_int32_t MG_SESSION_LOG_BUF_SIZE = 1 * MG_MB;
     33static const u_int32_t MG_MAX_TRANSACTIONS     = 1000;
     34static const u_int32_t MG_SESS_DB_PAGE_SIZE    = 2 * MG_KB;
    3335static const u_int32_t MG_SESS_DBXML_PAGE_SIZE = 512;
    3436// Set lock and transaction timeout to 0.2 seconds
    35 static const u_int32_t MG_DB_ENV_TIMEOUT = 200000;
     37static const u_int32_t MG_DB_ENV_TIMEOUT       = 200000;
    3638
    3739class MgDatabase;
Note: See TracChangeset for help on using the changeset viewer.