B
B
Begetan2016-04-02 13:00:03
go
Begetan, 2016-04-02 13:00:03

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

6 answer(s)
S
sim3x, 2016-04-02
@sim3x

1+
2+- use if you need to rewrite systemd for some of your needs
3- use the ancient protocol - mauvais ton

C
cy-ernado, 2016-04-02
@cy-ernado

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.

O
Oleg Shevelev, 2016-04-02
@mantyr

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.

A
Alexander Pavlyuk, 2016-04-02
@pav5000

It is better to demonize by external means. systemd or docker for example.

U
uvelichitel, 2016-04-04
@uvelichitel

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.

K
KkJ, 2016-04-08
@KkJ

Consul+go-micro

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question