Relates to: torrust/torrust-compose#2
I'm setting up a live demo for the Index and Tracker:
After running the containers in the smallest Digital Ocean droplet I run out of disk. The instance has 25GB. I found out the problem was the Tracker logs, in a couple of days the log file size is 21GB 😮.
I've truncated the log file manually with these two commands:
Find log file for tracker:
$ sudo : > $(docker inspect --format='{{.LogPath}}' tracker)
-bash: /var/lib/docker/containers/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e-json.log: Permission denied
Truncate the file:
sudo truncate -s 0 /var/lib/docker/containers/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e-json.log
I can change the docker compose file to limit the log size. See https://docs.docker.com/compose/compose-file/compose-file-v3/#logging but we should make the log
less verbose.
Example log:
$ sudo tail /var/lib/docker/containers/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e-json.log
{"log":"2023-12-14T11:20:55.273246832+00:00 [torrust_tracker::servers::udp::server][INFO] 16 bytes sent\r\n","stream":"stdout","time":"2023-12-14T11:20:55.273453315Z"}
{"log":"2023-12-14T11:20:55.294252436+00:00 [torrust_tracker::servers::udp::server][INFO] Received 16 bytes\r\n","stream":"stdout","time":"2023-12-14T11:20:55.29467371Z"}
{"log":"2023-12-14T11:20:55.294813382+00:00 [torrust_tracker::servers::udp::server][INFO] Sending 16 bytes ...\r\n","stream":"stdout","time":"2023-12-14T11:20:55.294968478Z"}
{"log":"2023-12-14T11:20:55.295131363+00:00 [torrust_tracker::servers::udp::server][INFO] 16 bytes sent\r\n","stream":"stdout","time":"2023-12-14T11:20:55.295311499Z"}
{"log":"2023-12-14T11:20:55.296958051+00:00 [torrust_tracker::servers::udp::server][INFO] Received 100 bytes\r\n","stream":"stdout","time":"2023-12-14T11:20:55.29726668Z"}
{"log":"2023-12-14T11:20:55.297364970+00:00 [torrust_tracker::servers::udp::server][INFO] Sending 43 bytes ...\r\n","stream":"stdout","time":"2023-12-14T11:20:55.29770331Z"}
{"log":"2023-12-14T11:20:55.297629194+00:00 [torrust_tracker::servers::udp::server][INFO] 43 bytes sent\r\n","stream":"stdout","time":"2023-12-14T11:20:55.297944733Z"}
{"log":"2023-12-14T11:20:55.327171107+00:00 [torrust_tracker::servers::udp::server][INFO] Received 16 bytes\r\n","stream":"stdout","time":"2023-12-14T11:20:55.327617363Z"}
{"log":"2023-12-14T11:20:55.327258346+00:00 [torrust_tracker::servers::udp::server][INFO] Sending 16 bytes ...\r\n","stream":"stdout","time":"2023-12-14T11:20:55.327676931Z"}
{"log":"2023-12-14T11:20:55.327333151+00:00 [torrust_tracker::servers::udp::server][INFO] 16 bytes sent\r\n","stream":"stdout","time":"2023-12-14T11:20:55.327887467Z"}
Maybe we should only log send and received bytes in debug mode? @WarmBeer @da2ce7.
These are the current stats for the tracker:
{
"torrents": 53371,
"seeders": 205,
"completed": 115188,
"leechers": 372,
"tcp4_connections_handled": 26,
"tcp4_announces_handled": 0,
"tcp4_scrapes_handled": 26,
"tcp6_connections_handled": 0,
"tcp6_announces_handled": 0,
"tcp6_scrapes_handled": 0,
"udp4_connections_handled": 21822485,
"udp4_announces_handled": 12969080,
"udp4_scrapes_handled": 398379,
"udp6_connections_handled": 0,
"udp6_announces_handled": 0,
"udp6_scrapes_handled": 0
}
Relates to: torrust/torrust-compose#2
I'm setting up a live demo for the Index and Tracker:
After running the containers in the smallest Digital Ocean droplet I run out of disk. The instance has 25GB. I found out the problem was the Tracker logs, in a couple of days the log file size is 21GB 😮.
I've truncated the log file manually with these two commands:
Find log file for tracker:
Truncate the file:
sudo truncate -s 0 /var/lib/docker/containers/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e/397484cca9572d98524e4f81095bb27f90c349306c39bc517afe5bcb3a6d7f5e-json.logI can change the docker compose file to limit the log size. See https://docs.docker.com/compose/compose-file/compose-file-v3/#logging but we should make the log
less verbose.
Example log:
Maybe we should only log send and received bytes in debug mode? @WarmBeer @da2ce7.
These are the current stats for the tracker: