![]() Compared with the file mode, this process causes much greater overhead. In stdout mode, logs must go through several processes (such as the commonly used JSON LogDriver) from an application to a server: application stdout > DockerEngine > LogDriver > serialization to JSON > saving to a file > collection by the agent > JSON parsing > uploading to the server. In business scenarios, we recommend that you use the file mode whenever possible. However, this recommendation is based on scenarios where containers are used as simple applications. ![]() The logs can be stored in different ways such as default storage, EmptyDir, HostVolume, and NFS.Äocker officially recommends using stdout to output logs. In containers, logs can be written into files in a similar way as physical machines or virtual machines. DockerEngine takes over the stdout or stderr file descriptor and processes the received logs according to the LogDriver rules configured for the DockerEngine. In containers, logs are directly output to stdout or stderr in standard output mode. Unlike virtual machines or physical machines, Kubernetes containers support the standard output mode and the file mode. The following table summarizes the comparison between these collection methods: Sidecar is recommended for ultra-large clusters.DaemonSet applies to small- and medium-sized clusters.Business direct writing is recommended for scenarios with a large number of logs.DockerEngine direct writing is not recommended in general scenarios.It applies to large Kubernetes clusters or clusters that serve multiple business parties as Platform-as-a-Service (PaaS) platforms. Sidecar consumes more resources and provides great scalability and tenant data segregation capability. The log agent collects logs from one business application. In Sidecar mode, a separate log collection agent is deployed for each pod.It applies to clusters with a single feature or few businesses. DaemonSet consumes much fewer resources and provides limited scalability and tenant data segregation capability. In DaemonSet mode, only one log agent runs on each node to collect logs from the node.Therefore, this method is used only in scenarios with a large number of logs. However, the business is bound with the log SDK, greatly compromising the overall flexibility. ![]() This method does not require additional agent deployment or the logic of flushing logs to disks, so it consumes the fewest system resources.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |