Giter Site home page Giter Site logo

Comments (2)

nmiyake avatar nmiyake commented on May 29, 2024

A few things that would be helpful:

  • Can you add a timer in your init function to print out the amount of time that it's taking?
  • If you run this a few times, what's the general range that you're seeing for this delta? The posted example seems to be about 9 seconds, and the title says up to 30.
  • Have you observed that the main server starts running quickly and only the management server takes several seconds to start, or is the startup delayed for both servers?

At the outset, I don't see any reason why it should take the management server this long to start. At the top level, the process is roughly:

(1) Run init function
(2) Construct management server and start it in a separate goroutine
(3) Construct main server and start it in the function

If the user-supplied init function is taking a long time that could slow the startup, but that should impact both management and the regular server.

from witchcraft-go-server.

nmiyake avatar nmiyake commented on May 29, 2024

Discussed further off-line, and we determined that the observed behavior is most likely due to a call being made in the user-supplied init function -- the user-supplied function was making a network call that could take a long time in some scenarios, and the consumer did not know that the management server is not started until the init function is complete.

To clarify, the user-supplied init function must complete without an error before the server (and management server, if it is separate) are started.

from witchcraft-go-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.