commit f76e655: [Minor] Maps: Jitter HTTP maps load to get better chances of SSL caching

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Feb 18 13:21:09 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-02-18 13:17:00 +0000
URL: https://github.com/rspamd/rspamd/commit/f76e655ca84d9f001434b8ee96b4951df2cd5156 (HEAD -> master)

[Minor] Maps: Jitter HTTP maps load to get better chances of SSL caching

---
 src/libserver/maps/map.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index a837b11ac..a832adc4f 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -1063,7 +1063,14 @@ rspamd_map_schedule_periodic (struct rspamd_map *map, int how)
 		timeout = map->poll_timeout;
 
 		if (how & RSPAMD_MAP_SCHEDULE_INIT) {
-			timeout = 0.0;
+			if (map->active_http) {
+				/* Spill maps load to get better chances to hit ssl cache */
+				timeout = rspamd_time_jitter (0.0, 2.0);
+			}
+			else {
+				timeout = 0.0;
+			}
+
 			reason = "init scheduled check";
 		}
 		else {


More information about the Commits mailing list