I have a simple http (no ssl) server running on raspbian written in dot net core (self contained app).

Currently it just presents a simple message.

The problem I'm facing is that it seems that the server is sleeping when idle.

First request takes up to 10 seconds to be answered.

Subsequent requests are immediate.

When server is on stanby for a period next request takes longer.

I tested requesting manually on telnet, the socket connects fast, processing the request is what is taking time.

Is there a configuration to keep it up and promptly all the time?

1 Answer 1


How about a cron task that will run curl on the endpoint every so often to keep it "hot"?

  • Nice workarround!
    – user116046
    Mar 16, 2020 at 23:33
  • @Edney Did this work for you? If so, please select this as an answer to your question. Thanks.
    – jwh20
    Mar 18, 2020 at 1:34
  • Actually I didn't test it, didn't had time. But I will not accept this as an anwer as this is a "workarround" kinda like a "hack". I'm looking for a proper way to avoid the process sleeping. Sorry. Thanx for help!
    – user116046
    Mar 18, 2020 at 8:14
  • In fact this is the correct way of keeping a process "hot" in Linux. In the case of the limited resources RPi, processes get swapped out of memory by other things that run normally and it takes some time to get it back and running. By "pinging" it periodically you keep it in memory and ready to respond to requests. I'm not clear what else you're looking for.
    – jwh20
    Mar 18, 2020 at 9:54
  • Is there a configuration to keep it up and promptly all the time?
    – user116046
    Mar 19, 2020 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.