Very slow HTTP responses on port 8000 inside seafile container

Hello!

I’m trying to setup a fresh Seafile 11 installation with Docker, using the official image/installation guide.

However, whatever I do, something seems fishy with the nginx-server inside the “seafile” Docker container.
A good example is to just Curl the http port:

root@tillberga: /nvme/seafile #> time curl -v http://172.20.0.6:80
*   Trying 172.20.0.6:80...
* Connected to 172.20.0.6 (172.20.0.6) port 80
> GET / HTTP/1.1
> Host: 172.20.0.6
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Server: nginx
< Date: Fri, 26 Jul 2024 22:36:19 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 0
< Connection: keep-alive
< Location: /accounts/login/?next=/
< Vary: Accept-Language, Cookie
< Content-Language: en
< 
* Connection #0 to host 172.20.0.6 left intact

real    0m4.275s
user    0m0.003s
sys     0m0.009s

It takes 4s+ just to respond with the redirect!

This is even confirmed by looking at the access log:

root@tillberga: /nvme/seafile #> tail -n1 logs/var-log/nginx/seahub.access.log
- 172.20.0.1 [27/Jul/2024:00:36:19 +0200] "GET / HTTP/1.1" 302 0 "-" "curl/8.5.0" 4.263

There are no obvious errors in the Docker log or anywhere else, it’s just this slowness that makes the service unusable.

Any ideas about where to start troubleshooting?

EDIT:
It seems like it’s actually the upstream seafile process that is slow to respond.
I get the same result even inside the container running curl http://127.0.0.1:8000.

Still no idea what’s wrong however.

So, after even more troubleshooting it turned out that the main problem was a firewall block between the Seafile container and memcached.

Got a lot of these logs in “seahub.log”:

pylibmc.ServerDown: error 47 from memcached_get(:1:autofilled): SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY
2024-07-27 00:04:56,529 [ERROR] django.pylibmc:167 set_many MemcachedError: error 47 from memcached_set_multi: SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/django_pylibmc/memcached.py", line 165, in set_many
    return super(PyLibMCCache, self).set_many(*args, **kwargs)
  File "/opt/seafile/seafile-server-11.0.8/seahub/thirdpart/django/core/cache/backends/memcached.py", line 127, in set_many
    failed_keys = self._cache.set_multi(
pylibmc.ServerDown: error 47 from memcached_set_multi: SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY
2024-07-27 00:04:56,539 [ERROR] django.pylibmc:132 get MemcachedError: error 47 from memcached_get(:1:ENABLE_TERMS_AND_CONDITIONS): SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY
Traceback (most recent call last):

I got a somewhat restricted firewall setup, not allowing container ↔ container communication by default, totally forgot about that.

Everything is good!

// Emil