/ip hotspot user profile
set [ find default=yes ] on-login="/system script run maxupgrade" on-logout="/system script run maxupgrade"
{
:local i;
:local j 1024000;
:set i [ :len [/ip hotspot active find] ];
:if ($i=0) do={:set i 1;}
:local x ($j/$i);
:local y ($x/4);
:foreach i in=[/queue simple find] do={/queue simple remove $i;}
:local addr;
:local uname;
:foreach i in=[/ip hotspot active find] do={
:set addr [/ip hotspot active get $i address];
:set uname [/ip hotspot active get $i address];
/queue simple add name=$uname target=$addr packet-marks=maxupgrade max-limit="$y/$x" queue=ethernet-default/ethernet-default;
:local macby;
:local addrby;
:foreach m in=[/ip hotspot ip-binding find where bypassed] do={
:set addrby [/ip hotspot ip-binding get $m to-address];
:set macby [/ip hotspot ip-binding get $m mac-address];
/queue simple add name=$macby target=$addrby max-limit="$y/$x" queue=ethernet-default/ethernet-default;
}
}
}