CPU usage is going up

Correct, you would want to create a compound index, something like this

Posts._ensureIndex({
 type:1,
 x: 1,
 y: 1,
 last_activity: 1
});

Let me know if that helps

If you are using Blaze, create a template helper
I think that way, it will be reactive.

Where is this code you posted, the client? An index will only help server side. If you publish/subscribe in the standard way, the client should see reactive updates to the collection via the reactivity of the cursor returned by find on the client

Sorry, this code is indeed server side. The server calculates a players X and Y, and pushes back data between an X and Y value. Simple video game logic.

The file is /imports/posts.js wrapped in an Meteor.isServer{

Question: If the value of X and Y are changing all the time, up to 1 time per second, I can still index for performance gains yes?

Sure am!

Iā€™ve got the template helper, but for some reason it doesnā€™t get new data. Perhaps itā€™s a simple mis-configuration. Iā€™ve put it off exploring for a while until I got other bugs and deployment server worked out; revisiting now. Iā€™ve learned so much!

Great vid on indexing,

1 Like

Your linode has probably been compromised since they donā€™t set you up with SSH keys initially. Had this a few times!