Comments (6)
This is a difficult question. My server has 1.5 GB memory and 2 cores. It runs a single mongo replica set and the apm server. After about 2 weeks the UI and aggregation is getting very slow. It helps to clean up the database (I don't need data older than 2 weeks, so it is fine for me).
I have 6 servers and 1 application with 200 to 500 users online at the same time. So there are a lot of data generated.
The big performance problem is the incremental aggregation which takes longer and longer after a while. Problems starts when the aggregations takes longer than the interval. I am sure that it is possible to handle it.
I would recommend to use at least two cores if you use a single server for the apm and database. Memory is not so important (500mb should be fine).
from meteor-apm-server.
I've got it running on a single core Lightsail instance and with more than about 2-3 weeks worth of data it becomes unusable because the aggregation methods are called faster than they can complete.
I saw your todo note to configure a timeout for pruning old data @lmachens, have you had a chance yet to look at exactly what the aggregation is doing and whether there's any optimisations to be made there? It seems odd that the entire historical data set needs to be crunched every X minutes...
from meteor-apm-server.
@markreid Yes, I know that problem. I think the best way is to optimize the query and indexes. The aggregation is incremental.
async function runAll() {
await incrementalAggregation(PROFILES['1min'], PROVIDERS['errors']);
await incrementalAggregation(PROFILES['1min'], PROVIDERS['methods']);
await incrementalAggregation(PROFILES['1min'], PROVIDERS['pubsub']);
await incrementalAggregation(PROFILES['1min'], PROVIDERS['system']);
await incrementalAggregation(PROFILES['30min'], PROVIDERS['errors']);
await incrementalAggregation(PROFILES['30min'], PROVIDERS['methods']);
await incrementalAggregation(PROFILES['30min'], PROVIDERS['pubsub']);
await incrementalAggregation(PROFILES['30min'], PROVIDERS['system']);
await incrementalAggregation(PROFILES['3hour'], PROVIDERS['errors']);
await incrementalAggregation(PROFILES['3hour'], PROVIDERS['methods']);
await incrementalAggregation(PROFILES['3hour'], PROVIDERS['pubsub']);
await incrementalAggregation(PROFILES['3hour'], PROVIDERS['system']);
}
Meteor.startup(() => {
runAll();
setInterval(runAll, 60000);
});
I think 1min depends on raw, 30min depends on 1min and 3hours depends on 30min.
The 1min should be fast, because the raw data is removed after the aggregation.
if (SourceCollection === PROVIDER.rawCollection) {
// Clean rawCollection
PROVIDER.rawCollection.remove(query);
}
I would take a deeper look to MapReduce(SourceCollection, DestCollection, PROVIDER.map, PROVIDER.reduce, options);
and check if the mongo indexes makes sense. Maybe there is more data we can remove directly after the aggregation.
from meteor-apm-server.
I did some improvements to the indexes and cleanup.
In addition, you can set the maximum lifetime of metrics in the settings.json
.
Example (default 7 days ^= 604800000) :
"metricsLifetime": 604800000
Please give me feedback if this changes makes the apm server more stable.
from meteor-apm-server.
The changes look good, I haven't been the server running long enough to detect issues.
from meteor-apm-server.
For what it's worth I've been running the server on a t2-micro for non-production loads (my app has fewer than 50 concurrent users) & it's working fine so far.
from meteor-apm-server.
Related Issues (20)
- No 'Access-Control-Allow-Origin' header is present HOT 39
- Denial of Service changes? HOT 1
- Excessive disk space usage HOT 9
- Method '__dynamicImport' not found HOT 2
- Mongodb constantly at 100%+ of CPU HOT 24
- Documenting issues HOT 4
- Connection successful but nothing displayed HOT 2
- App collaboration feature doesn't work because users can't register HOT 6
- Less Import Error During Deploy HOT 2
- Kadira Successfully connected but no data HOT 17
- Error: 'very strange! - no entries found' HOT 5
- Increase the frequency of traces HOT 1
- UI crashes after a while HOT 2
- Email alerts are overly active HOT 11
- Please fix HOT 1
- Update docker image to 1.3.0 HOT 1
- Looking for maintainers HOT 6
- Unable to use agent package with meteor-apm-server HOT 2
- Are you looking for maintainer? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-apm-server.