1

I have amazon aws ubuntu 18.04 server 8GB RAM and 50GB Storage. I have installed MongoDB 4.2 and Node JS 12 LTS.

In current server has 30 GB MongoDB storage. I have 4 micro service on same server. I have installed pm2 to start all 4 services.

Don't know why my all services responds delay.

For example:

I have checked pm2 start 0 it takes 4-5 mins to show logs.

I have already remove db caching and flush pm2 logs. But still mongodb service takes 50% CPU usage.

I have checked all code and found there is no 3rd party APIs call and optimize all queries and adding indexing on server. But still server taking too much times.

Most of time I got server timeout error. Please assist me. How to make my server fast.

2
  • what's the output of cat /proc/sys/net/ipv6/conf/all/disable_ipv6? If is 0, then you should add some directives in your sysctl.conf and reload kernel parameters. – Marcel Sep 8 '20 at 15:25
  • @Marcel yes it is 0. What should I add in sysctl.conf file? – Rakesh Singh Sep 9 '20 at 7:14
-1
+50

TL;DR: I recently troubleshoot a node server that was trying to resolve names on IPv6 before falling back to IPv4, and this was the solution to my problem (YMMV):

Try the following:

  • Open Terminal

  • Edit /etc/sysctl.conf and open the configuration file and add the following lines at the end

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
  • Type command sudo sysctl -p you will see this in terminal.
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
  • After that run $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6 - If it reports 1 means you have disabled IPV6.

Restart your node server.

HTH

3
  • Hope it works for me. – Rakesh Singh Sep 9 '20 at 9:23
  • Warning: This disables IPv6 but does nothing to resolve whatever the underlying problem is. – Michael Hampton Sep 9 '20 at 17:55
  • It doesn't help me. – Rakesh Singh Sep 10 '20 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.