test: CI/CD pipeline staging test - Redis aktiviert, Bad Gateway dokumentiert
This commit is contained in:
@@ -411,17 +411,54 @@ docker compose logs redis
|
||||
|
||||
### Performance Issues
|
||||
|
||||
```bash
|
||||
# Check MySQL slow queries
|
||||
docker exec gitea-mysql tail -100 /var/log/mysql/slow-queries.log
|
||||
**If Gitea has frequent outages or connection issues:**
|
||||
|
||||
# Analyze MySQL performance
|
||||
docker exec gitea-mysql mysql -u root -p$MYSQL_ROOT_PASSWORD \
|
||||
-e "SHOW PROCESSLIST;"
|
||||
1. **Update Gitea Configuration** (Recommended):
|
||||
```bash
|
||||
cd deployment/ansible
|
||||
ansible-playbook -i inventory/production.yml \
|
||||
playbooks/update-gitea-config.yml \
|
||||
--vault-password-file secrets/.vault_pass
|
||||
```
|
||||
|
||||
This playbook will:
|
||||
- Enable Redis cache for better performance and persistence
|
||||
- Configure database connection pooling
|
||||
- Set connection limits to prevent "Connection reset by peer" errors
|
||||
|
||||
# Check Redis memory usage
|
||||
docker exec gitea-redis redis-cli -a $REDIS_PASSWORD INFO memory
|
||||
```
|
||||
2. **Manual Troubleshooting**:
|
||||
```bash
|
||||
# Check PostgreSQL slow queries
|
||||
docker exec gitea-postgres psql -U gitea -d gitea -c "SELECT * FROM pg_stat_activity;"
|
||||
|
||||
# Check container resource usage
|
||||
docker stats gitea gitea-postgres gitea-redis
|
||||
|
||||
# Check Gitea logs for errors
|
||||
docker compose logs --tail 100 gitea | grep -i error
|
||||
|
||||
# Check Redis connection
|
||||
docker exec gitea-redis redis-cli -a $REDIS_PASSWORD ping
|
||||
```
|
||||
|
||||
### Known Issues
|
||||
|
||||
**Bad Gateway after many rapid requests (15-20 reloads):**
|
||||
- **Status**: Known issue, non-critical
|
||||
- **Symptoms**: Gitea returns "Bad Gateway" after 15-20 rapid page reloads, recovers after a few seconds
|
||||
- **Impact**: Low - Gitea is functional for normal usage
|
||||
- **Possible causes**:
|
||||
- Container restart during high load
|
||||
- Connection pool exhaustion (mitigated with increased limits)
|
||||
- Traefik service discovery delay in host network mode
|
||||
- **Workarounds**:
|
||||
- Wait a few seconds and retry
|
||||
- Use Redis cache (already enabled) for better performance
|
||||
- Consider adding rate limiting if needed (see Traefik middlewares)
|
||||
- **Future improvements**:
|
||||
- Monitor and optimize connection pool usage
|
||||
- Consider adding rate limiting middleware for Gitea
|
||||
- Investigate Traefik service discovery in host network mode
|
||||
|
||||
### Reset Admin Password
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ services:
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
networks:
|
||||
- traefik-public
|
||||
- gitea-internal
|
||||
@@ -18,10 +19,14 @@ services:
|
||||
- GITEA__database__NAME=${POSTGRES_DB:-gitea}
|
||||
- GITEA__database__USER=${POSTGRES_USER:-gitea}
|
||||
- GITEA__database__PASSWD=${POSTGRES_PASSWORD:-gitea_password}
|
||||
- GITEA__cache__ENABLED=false
|
||||
- GITEA__cache__ADAPTER=memory
|
||||
- GITEA__session__PROVIDER=file
|
||||
- GITEA__queue__TYPE=channel
|
||||
- GITEA__cache__ENABLED=true
|
||||
- GITEA__cache__ADAPTER=redis
|
||||
- GITEA__cache__HOST=redis:6379
|
||||
- GITEA__cache__PASSWORD=${REDIS_PASSWORD:-gitea_redis_password}
|
||||
- GITEA__session__PROVIDER=redis
|
||||
- GITEA__session__PROVIDER_CONFIG=network=tcp,addr=redis:6379,password=${REDIS_PASSWORD:-gitea_redis_password},db=0,pool_size=100,idle_timeout=180
|
||||
- GITEA__queue__TYPE=redis
|
||||
- GITEA__queue__CONN_STR=redis://:${REDIS_PASSWORD:-gitea_redis_password}@redis:6379/0
|
||||
- GITEA__server__DOMAIN=${GITEA_DOMAIN:-git.michaelschiemer.de}
|
||||
- GITEA__server__ROOT_URL=https://${GITEA_DOMAIN:-git.michaelschiemer.de}/
|
||||
- GITEA__server__SSH_DOMAIN=${GITEA_DOMAIN:-git.michaelschiemer.de}
|
||||
@@ -32,8 +37,6 @@ services:
|
||||
- gitea-data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "2222:22" # SSH for Git operations
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
|
||||
@@ -47,6 +50,8 @@ services:
|
||||
|
||||
# Service
|
||||
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
||||
# Use container name explicitly for host network mode
|
||||
- "traefik.http.services.gitea.loadbalancer.server.scheme=http"
|
||||
|
||||
# Middleware
|
||||
- "traefik.http.routers.gitea.middlewares=default-chain@file"
|
||||
@@ -68,6 +73,7 @@ services:
|
||||
- POSTGRES_DB=gitea
|
||||
- POSTGRES_USER=gitea
|
||||
- POSTGRES_PASSWORD=gitea_password
|
||||
command: postgres -c max_connections=300
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
@@ -77,32 +83,36 @@ services:
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
# redis (disabled for now; Gitea configured to not use redis)
|
||||
# redis:
|
||||
# image: redis:7
|
||||
# container_name: gitea-redis
|
||||
# restart: unless-stopped
|
||||
# networks:
|
||||
# - gitea-internal
|
||||
# environment:
|
||||
# - TZ=Europe/Berlin
|
||||
# volumes:
|
||||
# - redis-data:/data
|
||||
# command: redis-server --appendonly yes
|
||||
# healthcheck:
|
||||
# test: ["CMD", "redis-cli", "ping"]
|
||||
# interval: 30s
|
||||
# timeout: 10s
|
||||
# retries: 3
|
||||
# start_period: 10s
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: gitea-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- gitea-internal
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
command: >
|
||||
redis-server
|
||||
--requirepass ${REDIS_PASSWORD:-gitea_redis_password}
|
||||
--appendonly yes
|
||||
--maxmemory 512mb
|
||||
--maxmemory-policy allkeys-lru
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
gitea-data:
|
||||
name: gitea-data
|
||||
postgres-data:
|
||||
name: gitea-postgres-data
|
||||
# redis-data:
|
||||
# name: gitea-redis-data
|
||||
redis-data:
|
||||
name: gitea-redis-data
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
http:
|
||||
routers:
|
||||
gitea:
|
||||
rule: Host(`git.michaelschiemer.de`)
|
||||
entrypoints:
|
||||
- websecure
|
||||
service: gitea
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
priority: 100
|
||||
services:
|
||||
gitea:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: http://gitea:3000
|
||||
# Gitea configuration is now handled via Docker labels in docker-compose.yml
|
||||
# This file is kept for reference but is not used
|
||||
# Traefik will automatically discover Gitea via Docker labels and use the container IP
|
||||
# when running in host network mode
|
||||
#
|
||||
# http:
|
||||
# routers:
|
||||
# gitea:
|
||||
# rule: Host(`git.michaelschiemer.de`)
|
||||
# entrypoints:
|
||||
# - websecure
|
||||
# service: gitea
|
||||
# tls:
|
||||
# certResolver: letsencrypt
|
||||
# priority: 100
|
||||
# services:
|
||||
# gitea:
|
||||
# loadBalancer:
|
||||
# servers:
|
||||
# - url: http://gitea:3000
|
||||
|
||||
Reference in New Issue
Block a user