Answer the question
In order to leave comments, you need to log in
What is the best way to run a serious GO web service in production?
I'm going to start a web service that implements a RESTfull API. In the future, it needs to be extensible as the load grows. Linux Debian or Ubuntu platform.
Interested in the best way to organize the work of the program in Go?
Suggested options:
1. Starting the service with daemonization using the built-in systemd.
2. Using several libraries for native daemonization of a Go application.
3. Using Nginx and running a go application in fcgi wrapper.
All three tips are found while studying answers on Toster. I would like to hear the opinion of people with real experience in launching loaded services.
Answer the question
In order to leave comments, you need to log in
1+
2+- use if you need to rewrite systemd for some of your needs
3- use the ancient protocol - mauvais ton
systemd works well.
If you need a deposit for a huge expansion, then you can take Kubernetes, but be sure to study the need for this.
Docker containers can be run through systemd as well.
Fcgi is not to be used exactly. If you need huge http performance, then look at https://github.com/valyala/fasthttp
If you work with json, then https://github.com/mailru/easyjson
Go http server does not really need nginx in front of it, by the way.
supervisord and if its functions for external monitoring and control are not called in the future - its own supervisor written in Golang for its own requirements.
It should be borne in mind that supervisord is a python program, but it copes with its task with a bang and is suitable for running anything.
It is better to demonize by external means. systemd or docker for example.
fcgi - slow. systemd will nicely restart the service when it crashes. If you want to restart the service live, without losing client connections, for example, for update / upgrade, then you need a native solution, systemd cannot do this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question