rule "sets" ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
uxhamby
Normal user
Posts: 132
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

rule "sets" ?

#1 Post by uxhamby » 15 Feb 2021, 20:45

How do the various rule "sets" co exist with one another?

If I have a rule set 1 and a rule set 2, when I 'submit', do both sets get applied, or just the one actively on screen when I press submit?

I searched, but couldn't find any docs on this. What is the thinking behind having multiple rule sets?

Thanks,

Brian H.
Uxbridge Ont.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: rule "sets" ?

#2 Post by Ath » 15 Feb 2021, 21:27

The rules are split in 4 parts, because in the past, uploading them as 1 big file caused issues. This has been changed since then, but the 4 files have stayed around.
Also, there used to be a size 'limit' of around 2 kB, but that was also related to the issue-full file handling, that is now solved. Technically it is possible to store all your rules in rules 1, but that can be a bit hard to maintain. You can of course use an external editor (don't use Word or a similar word processor, but a decent editor like Notepad++ on Windows or VSCode or Atom on your favorite platform). You can even 'pre-process' that file to remove any comments before uploading, and then paste it into the rules 1 set. Smaller is better, in terms of rules parsing by your ESP.
Rules files are in fact read serially from 1 to 4 until the event that is about to be processed is found.

So if you have rules that fire often, put them in rules 1 at the top of the file. Rules that hardly ever fire can go to rules 2 or 3, or even 4 if you have many rules. Or just put them in rules 1 and delete the other rules files, that'll be a little bit quicker, but not very much.
/Ton (PayPal.me)

User avatar
uxhamby
Normal user
Posts: 132
Joined: 29 Dec 2016, 18:13
Location: Toronto Canada

Re: rule "sets" ?

#3 Post by uxhamby » 15 Feb 2021, 22:00

Thanks

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: rule "sets" ?

#4 Post by hestia » 25 Mar 2021, 20:24

Ath wrote: 15 Feb 2021, 21:27 Also, there used to be a size 'limit' of around 2 kB, but that was also related to the issue-full file handling, that is now solved. Technically it is possible to store all your rules in rules 1
I still have this message

Code: Select all

Current size: 2110 characters (Max 2048)Filesize exceeds web editor limit!
Does that means the limit is the editor only and that I could "use an external editor"?
How to upload it after?
"paste it into the rules 1 set" Am I going to have the save error?
"You can even 'pre-process' that file to remove any comments before uploading" do you have a tool?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: rule "sets" ?

#5 Post by TD-er » 25 Mar 2021, 21:18

That message is obsolete and can be ignored.
But keep in mind it has not been tested with "large" rules sets.
I did test with rules of 6k and those worked fine, but I don't know whether you may run into issues (if any) with longer rules files.
You can also upload them via the filesystem browser page, as the JavaScript also uses that link to upload the rules from the editor page.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: rule "sets" ?

#6 Post by Ath » 25 Mar 2021, 21:21

hestia wrote: 25 Mar 2021, 20:24 "You can even 'pre-process' that file to remove any comments before uploading" do you have a tool?
No, sorry, I would probably use some (regular expression) find/replace in Notepad++, but I haven't had to use that myself (yet).
/Ton (PayPal.me)

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: rule "sets" ?

#7 Post by hestia » 25 Mar 2021, 21:45

Thanks both of you for your quick replies
as I don't think I going to have more than 6k I'm going to stay with the native editor

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: rule "sets" ?

#8 Post by TD-er » 25 Mar 2021, 23:49

The rules edit page should not have any issue with longer rules.
It just uses the upload url which can perfectly upload longer files.
I once noticed a massive slowdown with files over 24 - 32k, but that was mainly with appending to a file on a SPIFFS file system.
But that's not what you're doing with the rules, so there may be some performance hit on larger files, but I guess the biggest impact is when reading those larger files when handling events mainly because they are larger.

Just place the most frequently used event blocks on the top of the first file and maybe some 'dummy' blocks on events that may happen often even when you don't want to use them in rules.
That's probably the biggest speed-improvement you can get anyway and then I guess it hardly doesn't matter if you're parsing a small or a large rules file.

One thing to keep in mind though.
When you cross a "8k" size increment (8k/16k/24k) you will see higger effects on fragmented file systems. On a 4M node that's almost never an issue, but on an 1M node it may become an issue quite fast when editing the rules often. (or any other settings)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 16 guests