This is an old revision of the document!
Table of Contents
Servidores Recesvinto
192.168.1.210 NAS
Instalamos tmux, opencode
Creo FTP para las camaras:
docker run -d \ --name ftp-server \ --restart unless-stopped \ -p 21:21 \ -p 21000-21010:21000-21010 \ -e "USERS=camara_patio_general|cpg_99|/ftp/camara_patio_general|6901|6901 camara_wifi_antenas|cwa_99|/ftp/camara_wifi_antenas|6902|6902 camara_bateria_uno|cbu_99|/ftp/camara_bateria_uno|6903|6903 camara_bateria_dos|cbd_99|/ftp/camara_bateria_uno|6904|6904 jose|jose_99|/ftp/jose|6905|6905" \ -e "ADDRESS=192.168.1.211" \ -e "MIN_PORT=21000" \ -e "MAX_PORT=21010" \ -v /mnt/datos/ftp:/ftp \ delfer/alpine-ftp-server
Creamos los directorios:
mkdir -p /mnt/datos/ftp/camara_patio_general sudo chown 6901:6901 /mnt/datos/ftp/camara_patio_general
mkdir -p /mnt/datos/ftp/camara_wifi_antenas sudo chown 6902:6902 /mnt/datos/ftp/camara_wifi_antenas mkdir -p /mnt/datos/ftp/camara_bateria_uno sudo chown 6903:6903 /mnt/datos/ftp/camara_bateria_uno mkdir -p /mnt/datos/ftp/camara_bateria_dos sudo chown 6904:6904 /mnt/datos/ftp/camara_bateria_dos mkdir -p /mnt/datos/ftp/jose sudo chown 6904:6904 /mnt/datos/ftp/jose
He hecho un test de velocidad de ftp:
| Fichero | Descarga (s) | Vel. Descarga | Subida (s) | Vel. Subida |
|---|---|---|---|---|
| 1 MB | 0.26 | 3.83 MB/s | 0.23 | 4.35 MB/s |
| 10 MB | 1.02 | 9.77 MB/s | 1.37 | 7.31 MB/s |
| 50 MB | 4.79 | 10.44 MB/s | 5.12 | 9.77 MB/s |
| 100 MB | 9.40 | 10.64 MB/s | 10.10 | 9.90 MB/s |
| 256 MB | 23.72 | 10.79 MB/s | 26.08 | 9.82 MB/s |
He configurado NFS y desde 192.168.1.200 estas son las pruebas de rendimiento:
Benchmark NFS - Raspberry - /mnt/datos
Fecha: 2026-09-07 20:50-20:55 Host cliente: docker Kernel: 6.12.48+deb13-amd64
Configuración NFS
192.168.1.211:/mnt/datos /mnt/datos nfs4 rw,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.200,local_lock=none,addr=192.168.1.211 0 0
Servidor: 192.168.1.211
Cliente: 192.168.1.200
Latencia ping: 0.5 ms
Enlace cliente: 1000 Mb/s full duplex (eno1)
Resultados
| Test | Medida | |
|---|---|---|
| dd escritura secuencial 512M | 10.8 MB/s | |
| dd escritura secuencial 512M (fdatasync) | 10.9 MB/s | |
| dd lectura secuencial 512M | 230 MB/s (en caché, no se pudieron soltar cachés) | |
| fio lectura secuencial 1M (direct=1) | 10.1 MB/s \ | 9 IOPS |
| fio escritura secuencial 1M (direct=1) | 7.9 MB/s \ | 7 IOPS |
| fio lectura aleatoria 4K (direct=1) | 0.95 MB/s \ | 233 IOPS |
| fio escritura aleatoria 4K (direct=1) | 0.94 MB/s \ | 230 IOPS |
Nota: los tests fio usan direct=1 (sin caché). El dd de lectura cachea en RAM del cliente (230 MB/s ≈ velocidad de memoria), el valor real sobre el cable es el del fio (~10 MB/s).
Conclusión
El rendimiento real sobre el cable es ~10 MB/s tanto en lectura como escritura, consistente con el hardware del servidor NFS:
- Servidor: Raspberry Pi 3 (confirmado por el usuario)
- NIC del servidor: 100 Mbps (máx. teórico 12.5 MB/s, ~10-11 MB/s reales con overhead NFS)
- Disco del servidor: HDD por USB 2.0 (además el Ethernet de la Pi 3 comparte bus USB 2.0)
- El enlace del cliente (1 Gb/s) NO es el límite; el cuello de botella es la PI3.
Referencia: para comparar en el futuro, el techo de este setup es ~11 MB/s. Si se quisiera más rendimiento habría que migrar a un servidor con NIC gigabit.
Benchmark NFS - /mnt/nfsnas (ZFS) : TRAS OPTIMIZACIÓN
Fecha: 2026-09-08 07:19-07:23
Host cliente: docker
Kernel: 6.12.48+deb13-amd64
Configuración NFS
192.168.1.250:/dades /mnt/nfsnas nfs4 rw,noatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,nconnect=4,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.200,local_lock=none,addr=192.168.1.250,_netdev 0 0
Servidor: 192.168.1.250 (nas, 2 CPU Debian 13)
Cliente: 192.168.1.200
Enlace cliente: 1000 Mb/s full duplex (eno1)
Sistema de archivos servidor: ZFS (pool dades, RAIDZ1)
Discos del pool: 4x Seagate ST8000DM004 (7.3T, SMR)
Cambios aplicados el 2026-09-08
- /etc/exports: en /dades y /srv/nas, opción cambió de
syncaasync(backup en /etc/exports.bak.YYYYMMDD) - zfs:
sync=disableden datasetsdadesydades/nas
NOTA de hardware: modelo ST8000DM004 = serie BarraCuda SMR (grabación manufacturada). Las escrituras aleatorias en SMR sufren penalización extrema sin async; por eso se necesitaba esta optimización.
Resultados tras optimización
| Test | Medida | |
|---|---|---|
| dd escritura secuencial 512M | 28.3 MB/s | |
| dd escritura secuencial 512M (fdatasync) | 37.0 MB/s | |
| dd lectura secuencial 512M | 100 MB/s | |
| fio lectura secuencial 1M (direct=1) | 95.9 MB/s \ | 91 IOPS |
| fio escritura secuencial 1M (direct=1) | 97.4 MB/s \ | 92 IOPS |
| fio lectura aleatoria 4K (direct=1) | 10.1 MB/s \ | 2471 IOPS |
| fio escritura aleatoria 4K (direct=1) | 10.2 MB/s \ | 2492 IOPS |
Comparativa ANTES vs DESPUÉS
| Test | Antes (sync) | Después (async) | Mejora |
|---|---|---|---|
| dd escritura sec. | 18.1 MB/s | 28.3 MB/s | x1.6 |
| fio esc. sec. 1M | 19.5 MB/s | 97.4 MB/s | x5.0 |
| fio esc. aleat. 4K | 0.155 MB/s (37 IOPS) | 10.2 MB/s (2492 IOPS) | x66 |
| fio lec. sec. 1M | 95.2 MB/s | 95.9 MB/s | - (igual, ya a tope) |
| fio lec. aleat. 4K | 9.2 MB/s | 10.1 MB/s | x1.1 |
Las escrituras ahora alcanzan ~tope de gigabit (igual que las lecturas). La escritura aleatoria 4K pasó de 37 → 2492 IOPS (x66) con async.
Riesgo asumido
sync=disabled / export async: si el servidor pierde la alimentación (sin SPS/UPS) se pueden perder datos aún no escritos de la última parte de la operación. El usuario tiene previsto instalar un SPS/UPS, que lo mitigará.
Nota comparativa Pi 3
| Test | Pi 3 (USB2+100Mbps) | ZFS sync | ZFS async |
|---|---|---|---|
| Escritura sec. dd | 10.8 MB/s | 18.1 | 28.3/37.0 |
| Escritura aleat. 4K | 0.945 (230) | 0.155 (37) | 10.2 (2492) |
| Lectura aleat. 4K | 0.955 (233) | 9.2 (2242) | 10.1 (2471) |
