How To Fix Lag Spikes on Server

I keep getting alerts from the monitoring feature I set up that say the site is experiencing high latency.

Server is node/express.

How do I go about fixing this? I tried profiling my app with --inspect, I also tried the 3rd party tool “Clinic” with different views, I tried looking at my google analytics, but still was unable to find anything useful.

All my resources seem to spike at the same time.

How do i even start thinking about how to solve this problem?

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.

This comment has been deleted

    Site Moderator
    Site Moderator badge
    January 6, 2023

    Hi @skeddtemp,

    It’s expected for the resources to jump at the same time. The reason behind these should be fairly simple. It’s possible you have some cronjob configured at the time of the spikes, or you have a bot crawling your website thus generating a high load.

    If you can find a pattern of when the spikes appear try logging in to your Droplet and caching the spike in real-time and trying to troubleshoot it. See what processes are running, use htop to see what is causing this high load, etc.

    Try DigitalOcean for free

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

    Sign up

    card icon
    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Sign up
    card icon
    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

    Learn more
    card icon
    Become a contributor

    You get paid; we donate to tech nonprofits.

    Learn more
    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

    Learn more ->
    DigitalOcean Cloud Control Panel
    Get started for free

    Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

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

    © 2023 DigitalOcean, LLC.