Note that there are some explanatory texts on larger screens.

plurals
  1. PONCache query performance issues
    primarykey
    data
    text
    <p>I am evaluating NCache for usage in the ongoing project as a "read-through" cache - in order to take off load from SQL server.<br/> At client-side, the project has a polling routine that receives items filtered (at server-side) by last polling datetime.<br/> The polling occurs at fixed interval at separate thread. <br/> The pseudo code for client-side<br/> 1) first time fetch:</p> <ol> <li>fetch all existing items</li> <li>set <b>LastHandledDate</b> to now</li> </ol> <p>2) non-first time fetch (polling thread)</p> <ol> <li>fetch existing items that were created after <b>LastHandledDate</b></li> <li>update <b>LastHandledDate</b> to now </li> </ol> <p>At server-side,when the polling query is received, the following pseudo-code is executed:<br/></p> <ol> <li>query NCache for all matching items with <b>CreationDate</b> >= <b>LastHandledDate</b></li> <li>IF query results are empty <ol> <li>query SQL database for all matching items with <b>CreationDate</b> >= <b>LastHandledDate</b></li> <li>if query is not empty then update NCache with SQL query results </li> <li>return SQL query results</li> </ol> </li> <li> ELSE return NCache query result</li> </ol> <p>To query NCache I am using it's linq provider, and the query is similar to SQL query:</p> <pre><code>SELECT * FROM Messages WHERE Message.SessionId = 1234 AND Message.EntryDate &gt;= ‘2012-10-6’ </code></pre> <p>Edit: During testing,on the client-side there is a thread that adds new items at a constant rate</p> <p>The server-side part is hosted in a web-service (WCF in IIS).<br/> After load testing the above polling setup with 100 clients for about an hour, I've noticed a steady decline in requests/sec the web-service was performing.</p> <p>Running the above setup with only reads from NCache, without SQL reads at all (without paragraph <b>2</b> at server-side pseudo-code) yielded the same decline pattern in requests/sec.</p> <p>I have several questions:</p> <ul> <li>It seems that NCache's query performance depends on total number of objects in the cache. Is this the case in similar solutions (NoSQL / Distributed Cache)</li> <li>Which NoSQL/Distributed Cache solution is optimized for querying speed?</li> <li>Maybe in the NCache the querying can be somehow more optimized?</li> <li>Perhaps I am missing something- and my usage pattern of distributed cache is incorrect - how can I use distributed cache such as NCache efficiently in my use case?</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload