Comments (2)
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.
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)
- Runtime config refreshable produces zero value if cannot parse yaml
- pprof/goroutine returns 404 HOT 2
- Add a default health check for a sliding window of events HOT 1
- TestNewInflightLimitMiddleware test flakes
- Separate out trace sampling for application routes and management routes
- Allow selecting which go metrics you care about to emit HOT 4
- Default server/client metrics too verbose, no option to trim down HOT 10
- log canceled request as 499 instead of 500 HOT 8
- Ability to shutdown server with error HOT 3
- Reduce default trace rate to 1%
- 404s do not produce request logs
- Opt-in diagnostic log upon turning unhealthy HOT 5
- Improved panic logging
- Liveness endpoint should return non-empty JSON object
- Metric loggers should emit 0 value before regular value for certain metric types HOT 1
- connection metrics
- Encrypted values in configuration should be decoded while maintaining YAML structure
- RouteHandlerMiddleware unwieldy for endpoint-specific handling
- Missing pprof routes
- Library equivalent to Java's ManagedScheduledTask
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from witchcraft-go-server.