moooofly / hunter-agent

This is an agent for hunter system as a proxy.
MIT License
2 stars 0 forks source link

hunter-agent function list #1

Open moooofly opened 6 years ago

moooofly commented 6 years ago

Core Features

Optional Features

moooofly commented 6 years ago

Unix Domain Socket v.s. Network Socket

A Unix domain socket is an inter-process communication mechanism that allows bidirectional data exchange between processes running on the same machine.

IP sockets (especially TCP/IP sockets) are a mechanism allowing communication between processes over the network. In some cases, you can use TCP/IP sockets to talk with processes running on the same computer (by using the loopback interface).

UNIX domain sockets know that they’re executing on the same system, so they can avoid some checks and operations (like routing); which makes them faster and lighter than IP sockets. So if you plan to communicate with processes on the same host, this is a better option than IP sockets.

UNIX domain sockets are subject to file system permissions, while TCP sockets can be controlled only on the packet filter level.

When the server and client benchmark programs run on the same box, both the TCP/IP loopback and unix domain sockets can be used. Depending on the platform, unix domain sockets can achieve around 50% more throughput than the TCP/IP loopback (on Linux for instance). The default behavior of redis-benchmark is to use the TCP/IP loopback.

list command:

netstat -naxp

Ref:

moooofly commented 6 years ago

Daemon or not Daemon, is a question

hunter-agent does not daemonize on its own. For production usage, it is recommended to launch in a process supervisor, and drop privileges as appropriate.

Examples of supervisors include: daemontools, runit, upstart, launchd, systemd, and many more.

For the reasoning behind lack of daemonization, see daemontools/why. In addition, the code is much simpler because of it.

other: 《golang 应用的 daemon 问题》 -- private