[Rspamd-Users] Fuzzy local
Rick Gutierrez
xserverlinux at gmail.com
Fri Jul 11 17:13:25 UTC 2025
El vie, 11 jul 2025 a las 0:20, Florian Piekert (<floppy at floppy.org>)
escribió:
> Hello,
>
>
Hi Florian
> what is the limit.conf that systemd found for redis? Do you have such a
> file in /etc/redis/ ? Is that the reason for the "script" that is "running"?
>
my system limit (global) is: ulimit -n
256000
for redis :
ps -u redis
PID TTY TIME CMD
36553 ? 00:00:01 redis-server
[root at rserver ~]$ grep 'open files' /proc/36553/limits
Max open files 10240 10240 files
In the redis directory I only have a couple of files, the configuration one
and another called sentinel.conf
ls -l
total 112
-rw-r-----. 1 root root 93883 Jul 2 10:57 redis.bck
-rw-r--r-- 1 root root 1549 Jul 10 22:05 redis.conf
-rw-r-----. 1 redis root 13793 May 15 21:40 sentinel.conf
> I only have the plain redis.conf there, the defaults work fine (OK, I
> modified some aspects like bind-source-addr or memory).
>
> Then in (applies for all 3 files) /etc/rspamd/local.d/ I have
> redis.conf
> -8<-
> write_servers = "localhost";
> read_servers = "localhost";
> -8<-
>
> fuzzy_check.conf
> -8<-
> # local.d/fuzzy_check.conf
> timeout = 4s;
> retransmits = 3;
>
> rule "local" {
> # Fuzzy storage server list
> servers = "localhost:11335";
>
> # Default symbol for unknown flags
> symbol = "LOCAL_FUZZY_UNKNOWN";
>
> # Additional mime types to store/check
> mime_types = ["application/*"];
>
> # Hash weight threshold for all maps
> max_score = 20.0;
>
> # Whether we can learn this storage
> read_only = no;
>
> # Ignore unknown flags
> skip_unknown = yes;
>
> # Hash generation algorithm
> algorithm = "mumhash";
>
> # Map flags to symbols
> fuzzy_map = {
>
> LOCAL_FUZZY_DENIED {
> # Local threshold
> max_score = 20.0;
> # Flag to match
> flag = 11;
> }
>
> LOCAL_FUZZY_PROB {
> max_score = 10.0;
> flag = 12;
> }
>
> LOCAL_FUZZY_WHITE {
> max_score = 2.0;
> flag = 13;
> }
> }
> }
> -8<-
> and in
>
> worker-fuzzy.inc
> -8<-
> bind_socket = "localhost:11335";
> # Number of processes to serve this storage (useful for read scaling)
> count = 16;
> # Backend ("sqlite" or "redis" - default "sqlite")
> backend = "redis";
> # Hashes storage time (3 months)
> expire = 90d;
> # Synchronize updates to the storage each minute
> sync = 1min;
> allow_update = [ "127.0.0.1", "::1" ];
> -8<-
>
> Florian
>
>
I have made some modifications to the worker-fuzzy.inc file, adapting it to
yours but I can't get the module to be enabled in the UI
I show how I have enabled fuzzy in rspamd.conf
# Local fuzzy storage is disabled by default
worker "fuzzy" {
bind_socket = "localhost:11335";
count = 4; # Disable by default, see #4677 for details
.include "$CONFDIR/worker-fuzzy.inc"
.include(try=true; priority=1,duplicate=merge)
"$LOCAL_CONFDIR/local.d/worker-fuzzy.inc"
.include(try=true; priority=10)
"$LOCAL_CONFDIR/override.d/worker-fuzzy.inc"
}
some logs , after modifying these files and reloading rspamd
2025-07-11 10:58:38 #36668(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script with id: 8 to 127.0.0.1:6379, sha:
7821ae9ca73268a540c8a091e880f77421535d39
2025-07-11 10:58:38 #36655(main) <a8f21e>; main; rspamd_fork_worker:
prepare to fork process fuzzy (15); listen on: localhost:11335
2025-07-11 10:58:38 #36671(fuzzy) <a8f21e>; main; rspamd_worker_set_limits:
use system max file descriptors limit: 1024KiB cur and 1024KiB max
2025-07-11 10:58:38 #36670(fuzzy) <xdbd4t>; cfg;
rspamd_dns_read_hosts_file: processed host file /etc/hosts; 4 records added
2025-07-11 10:58:38 #36671(fuzzy) <a8f21e>; main; rspamd_worker_set_limits:
use system max core size limit: -1B cur and -1B max
2025-07-11 10:58:38 #36671(fuzzy) <a8f21e>; main; rspamd_handle_child_fork:
starting fuzzy process 36671 (14); listen on: localhost:11335
2025-07-11 11:10:19 #36655(main) <a8f21e>; main; rspamd_cld_handler: do not
respawn process fuzzy after found terminated process with pid 36666
2025-07-11 11:10:21 #36700(main) <xdbd4t>; lua; init.lua:59: controller
plugin fuzzy; register webui path hashes
2025-07-11 11:10:22 #36700(main) <xdbd4t>; cfg; fuzzy_parse_rule: added
fuzzy rule FUZZY_UNKNOWN, key: ef43ae80cc8d, shingles_key: ef43ae80cc8d,
algorithm: mum
2025-07-11 11:10:22 #36700(main) <xdbd4t>; cfg; fuzzy_parse_rule: added
fuzzy rule LOCAL_FUZZY_UNKNOWN, key: ef43ae80cc8d, shingles_key:
ef43ae80cc8d, algorithm: mum
2025-07-11 11:10:22 #36700(main) <xdbd4t>; cfg; fuzzy_check_module_config:
init internal fuzzy_check module, 2 rules loaded
2025-07-11 11:10:22 #36700(main) <xdbd4t>; cfg;
rspamd_config_is_module_enabled: lua module fuzzy_collect is enabled but
has not been configured
2025-07-11 11:10:22 #36700(main) <xdbd4t>; cfg;
rspamd_config_is_module_enabled: fuzzy_collect disabling unconfigured lua
module
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script with id: 9 to 127.0.0.1:6379, sha:
391852662b06ef6ca67ed486de40a78b37da7dba
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script with id: 9 to 127.0.0.1:6379, sha:
391852662b06ef6ca67ed486de40a78b37da7dba
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_check.lua to 127.0.0.1:6379,
sha: 5f9159d290dffb1c548afa2e447209602dc41616
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_check.lua to 127.0.0.1:6379,
sha: 5f9159d290dffb1c548afa2e447209602dc41616
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_save_unlock.lua to 127.0.0.1:6379,
sha: d906f561d35dededcd1e14632349059e2e86ed86
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_save_unlock.lua to 127.0.0.1:6379,
sha: d906f561d35dededcd1e14632349059e2e86ed86
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_maybe_lock.lua to 127.0.0.1:6379,
sha: 2a40f4606d23e3d080b58a7a86d06dc0f6705056
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_maybe_lock.lua to 127.0.0.1:6379,
sha: 2a40f4606d23e3d080b58a7a86d06dc0f6705056
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_update.lua to 127.0.0.1:6379,
sha: 166518ccdf8d0aecb1bfc8b9334018ac4359e78f
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_train_size.lua to 127.0.0.1:6379,
sha: efbafbe6eb617b740483a1be3d1854fd037fa7b0
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_update.lua to 127.0.0.1:6379,
sha: 166518ccdf8d0aecb1bfc8b9334018ac4359e78f
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_cleanup_pending.lua to
127.0.0.1:6379, sha: cd653186a50918be9389f99095e2e34625004596
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: ratelimit_cleanup_pending.lua to
127.0.0.1:6379, sha: cd653186a50918be9389f99095e2e34625004596
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script with id: 8 to 127.0.0.1:6379, sha:
7821ae9ca73268a540c8a091e880f77421535d39
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script with id: 8 to 127.0.0.1:6379, sha:
7821ae9ca73268a540c8a091e880f77421535d39
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_maybe_invalidate.lua to
127.0.0.1:6379, sha: dc4556c7a1cd47d361b56026db3e644eea127d94
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_maybe_invalidate.lua to
127.0.0.1:6379, sha: dc4556c7a1cd47d361b56026db3e644eea127d94
2025-07-11 11:11:32 #36717(fuzzy) <xdbd4t>; lua; lua_redis.lua:1325:
uploaded redis script from file: neural_train_size.lua to 127.0.0.1:6379,
sha: efbafbe6eb617b740483a1be3d1854fd037fa7b0
2025-07-11 11:11:32 #36717(fuzzy) fuzzy_peer_rep: got peer fd reply from
the main process
2025-07-11 11:11:32 #36717(fuzzy) fuzzy_peer_rep: start listening on
127.0.0.1:11335
2025-07-11 11:11:32 #36716(fuzzy) fuzzy_peer_rep: got peer fd reply from
the main process
thnks for all!
--
rickygm
http://gnuforever.homelinux.com
More information about the Users
mailing list