Reputation: 173
I have a webApp built using meteor. Following are the specifications :
Meteor version : 1.8
Mongo Version : 4.0.5
Following is the list of packages I have used :
[email protected]
twbs:[email protected]
iron:router
[email protected]
fortawesome:fontawesome
[email protected]
[email protected]
mrt:mathjax
[email protected]
momentjs:moment
ian:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
jss:jstree
meteorhacks:subs-manager
aldeed:template-extension
reywood:publish-composite
[email protected]
stylus@=2.513.13
[email protected]
iron:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
simple:json-routes
[email protected]
aldeed:simple-schema
rafaelhdr:google-charts
meteorhacks:aggregate
The webApp is hosted on AWS ec2 instance with 16GB RAM and 04 processors. The application uses pub-sub method. Now the issue is that whenever there are more than 50 concurrent connections, the CPU usage crosses sixty-percent usage and the webApp becomes annoyingly slow to use. As per my findings, it could be because of two reasons, either the pub-sub schema that I have used is too heavy, i.e., I have used database subscriptions on each page extensively and meteor maintains an open connection continuously with it. Other reason that could be leading to extensive resource usage could be mongoDB usage. As per the dbStats, the db uses more than 06GB of RAM. Following are the details :
I am not sure why such behaviour. Only way I can think of is to hit and trial (remove subscriptions and then test), but it would be too time consuming and also not full proof.
Could someone help me out as to how to proceed.
Upvotes: 2
Views: 103
Reputation: 3226
Depending on the way your app is designed, data-wise, there can be several reasons for this lack of performance.
A few suggestions:
My best guess is that you probably need a mix of rationalizing the db "structure" and avoid the data aggregation as much as you can.
You may also have a misuse of the low level collection api (e.g. cursor.observe()
stuff) somewhere.
Upvotes: 1