4 ms·
Have you tried doing this in real time yet, or near real time with maybe a short lived cache? I mean, 100 points doesn't seem like much. If you just want the la
by latch 16y ago
Have you tried doing this in real time yet, or near real time with maybe a short lived cache? I mean, 100 points doesn't seem like much. If you just want the last load measurement for 100 servers, seems like a pretty lightweight mapreduce with an inline/streamed return value. You could cache the results in your app server for ~10seconds and have the front-end refresh every 10 seconds (giving you max-stale data of 20 seconds).
Beyond that, for your scaling question, I am a fan of generating reportable data asynchronously and keeping the UI stuff as a very simple select/find (which seems to be where you want to start). Each report would be its own transform - some of which might be more real-time than others. If your data is really huge and a single report is limited by MongoDB's single-threaded map-reduce, you'll need to look at the Mongo-Hadoop bridge.
Another solution is to simply store your data into a reportable format upfront. Of course, if you need to look at your data 50 different ways, it now turns into 50 inserts instead of just 1.
I think I'd try in real time, especially just for your initial cpu load, then move to an asynchronous transformation..and when that no longer meets your needs, deal with it then...I think it'll be a while before you get there.
You might be well served by asking this in the [active] MongoDB user group: https://groups.google.com/forum/#!forum/mongodb-user https://groups.google.com/forum/#!forum/mongodb-user
- Skywing 16y agoWhen you suggest trying it in real time, initially, are you saying to just go ahead and generate a new report every time the page is requested? I might as well go ahead and try this, knowing that it's not going to be under heavy user load. That might give me a good cpu load benchmark, as you said.
- latch 16y agoyes, though like I said, there's no reason you can cache the results for a short time (whatever works for you..I've seen as short as 5 seconds and as long as 5 hours). That way, if 10 users happen to look at it at the same time (common if you have an auto-refresh ajax thing going), it will keep the load low.