Question

node.js backend for api becomes unresponsive from time to time

node.js backend for api becomes unresponsive from time to time


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 22, 2024

Hi there,

Are you seeing a specific error when this happens? Would you mind sharing a bit more information about your setup?

  • Are you using a Droplet to host your Node.js app?
  • Or are you using the DigitalOcean App Platform?

If you are using a Droplet, here are a few things you might want to check:

  1. Check the CPU and memory usage of your Droplet. High usage can cause your Node.js app to become unresponsive.

    • You can use tools like htop or top to monitor resource usage in real-time.
    • Alternatively, you can check resource usage from the DigitalOcean Control Panel.
  2. Inspect your application logs and system logs for any errors or warnings that might indicate what’s causing the unresponsiveness.

    • Look at the Node.js application logs for any uncaught exceptions or errors.
    • Check /var/log/syslog or /var/log/messages for system-level issues.
  3. If your app connects to a database, ensure that your database is running smoothly and is not a bottleneck.

  • Check the database logs for any slow queries or connection issues.
  • Make sure your database has enough resources allocated.

If you are using the DigitalOcean App Platform:

  1. Service Metrics: Check the metrics provided by the platform to see if there are any spikes in resource usage or errors.
  2. Scaling Options: The App Platform allows you to easily scale your application by adjusting the instance size or adding more instances.
  3. Logs and Alerts: Make use of the logging and alerting features to monitor your application’s health and be notified of any issues.

Feel free to provide more details about your setup and the issues you’re encountering, and I’ll be happy to help further!

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.