Meteor app on EC2(free tier) very slow responsive

On local machine any changes are reflected instantly on screen(both browser & Android app) for e.g. if I write a comment in my app and press enter it shows my comment in Comment List immediately.

But on cloud(I have deployed on AWS EC2 free tier) it takes around 5-6 sec for the comment to appear in the comment list after I press enter. This creates mess, what happens is user keep on pressing enter button as comment don’t appear on screen. So eventually user end up with adding same comment as many times as much he pressed enter.

Is there anyway to show the such changes instantly on screen without waiting for server response and the sync it later with server? Or any best practises to handle such scenarios? Aa I am a newbie I don’t even know if its acceptable to wait for such a long time to get response from the EC2?

Try to remove all unwanted background processes. I removed Apache, mysql, phpmysqladmin etc which I hadd earlier installed. It is quite responsive and not much of a lag really.

Read the Optimistic UI section of the Guide. This is one of the many great things Meteor brings to the table. In this case your users shouldn’t have to wait for the client-server round trip, if you have things coded up to leverage Meteor’s optimistic UI capabilities.

hi @hwillson this guide is very useful. But i would like to tell that when user writes a comment and hit enter I call the server side method. Now when comment actually is inserted in db on server and subscription is update then only comment appears on the screen.

Is there anything where I can do insert locally and then call the server side method asynchronously?

Now when comment actually is inserted in db on server and subscription is update then only comment appears on the screen.

The advantage of meteor methods, that it could do this on the both: client and server. And if you are following the meteor guide it should work instantly. http://guide.meteor.com/methods.html

I am also using Meteor on the EC2 free tier and have no problems with high delays. I’ve implemented this with mupx on a fresh Ubuntu machine, works as a charm. Maybe it’s just the network connection? Where is your instance hosted, and where are you located?

Besides this, I also recommend that you delve into latency compensation via client-side Meteor methods, as suggested by the others. This improves the user experience a lot if you’re facing latency issues.

I implemented meteor methods in shared folder and its working like a charm.